How to use the type.call function in type

To help you get started, we’ve selected a few type examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github raptorjs-legacy / raptorjs / lib / raptor / widgets / widgets_browser.js View on Github external
var _doInitWidget = function() {
                    try
                    {
                        if (widget.initWidget) {
                            widget.initWidget(config);
                        }
                        else {
                            OriginalWidgetClass.call(widget, config);
                        }
                    }
                    catch(e) {
                        var message = 'Unable to initialize widget of type "' + type + '". Exception: ' + e;
                        
                        // NOTE:
                        // For widgets rendered on the server we disable errors from bubbling to allow the page to possibly function
                        // in a partial state even if some of the widgets fail to initialize.
                        // For widgets rendered on the client we enable bubbling to make sure calling code is aware of the error.
                        if (bubbleErrorsDisabled) {
                            logger.error(message, e);
                        }
                        else {
                            throw e;
                        }
                    }