test/widget-main/bower_components/core/scripts/modules/bus/eventemitter.js
/**
     * Executes each of the listeners in order with the supplied arguments.
     * @param   {String} event Name of the event
     * @returns {Object}       Chainable methods
     */
Executes each of the listeners in order with the supplied arguments.
@param   {String} event Name of the event
@returns {Object}       Chainable methods
Executes each of the listeners in order with the supplied arguments . @param { String } event Name of the event @returns { Object } Chainable methods
function emit(event) {
        var listeners = this.listeners(event).slice();
        var singleArg = arguments.length === 1;
        var slice = Array.prototype.slice;
        var idx = 0;
        var len = listeners.length;
        for ( ; idx < len; idx++) {
            if (singleArg) {
                if (defined(listeners[idx][1])) {
                    listeners[idx][0].call(listeners[idx][1]);
                }
                else {
                    listeners[idx][0]();
                }
            } else {
                listeners[idx][0].apply(listeners[idx][1], slice.call(arguments, 1));
            }
        }
        return this;
    }
function emit ( event ) { var listeners = this . listeners ( event ) . slice ( ) ; var singleArg = arguments . length === 1 ; var slice = Array . prototype . slice ; var idx = 0 ; var len = listeners . length ; for ( ; idx < len ; idx ++ ) { if ( singleArg ) { if ( defined ( listeners [ idx ] [ 1 ] ) ) { listeners [ idx ] [ 0 ] . call ( listeners [ idx ] [ 1 ] ) ; } else { listeners [ idx ] [ 0 ] ( ) ; } } else { listeners [ idx ] [ 0 ] . apply ( listeners [ idx ] [ 1 ] , slice . call ( arguments , 1 ) ) ; } } return this ; }
Executes each of the listeners in order with the supplied arguments.
Executes each of the listeners in order with the supplied arguments .