emitter.js
function( type ) {

      var emitter = this
      var listeners = this._events[ type ]

      if( type === 'error' && !listeners ) {
        if( !this._events.error ) {
          throw !( arguments[1] instanceof Error ) ?
            new Error( 'Unhandled "error" event.' ) :
            arguments[1]
        }
      } else if( !listeners ) {
        return false
      }

      var argv = [].slice.call( arguments, 1 )
      var i, len = listeners.length

      function fire( handler, argv ) {
        typeof handler !== 'function' ?
          handler.handleEvent.apply( handler, argv ) :
          handler.apply( this, argv )
      }

      for( i = 0; i < len; i++ ) {
        Emitter.nextTick(
          fire.bind( this, listeners[i], argv )
        )
      }

      return true

    }
function( type ) {

      var emitter = this
      var listeners = this._events[ type ]

      if( type === 'error' && !listeners ) {
        if( !this._events.error ) {
          throw !( arguments[1] instanceof Error ) ?
            new Error( 'Unhandled "error" event.' ) :
            arguments[1]
        }
      } else if( !listeners ) {
        return false
      }

      var argv = [].slice.call( arguments, 1 )
      var i, len = listeners.length

      function fire( handler, argv ) {
        typeof handler !== 'function' ?
          handler.handleEvent.apply( handler, argv ) :
          handler.apply( this, argv )
      }

      for( i = 0; i < len; i++ ) {
        Emitter.nextTick(
          fire.bind( this, listeners[i], argv )
        )
      }

      return true

    }
function ( type ) { var emitter = this var listeners = this . _events [ type ] if ( type === 'error' && ! listeners ) { if ( ! this . _events . error ) { throw ! ( arguments [ 1 ] instanceof Error ) ? new Error ( 'Unhandled "error" event.' ) : arguments [ 1 ] } } else if ( ! listeners ) { return false } var argv = [ ] . slice . call ( arguments , 1 ) var i , len = listeners . length function fire ( handler , argv ) { typeof handler !== 'function' ? handler . handleEvent . apply ( handler , argv ) : handler . apply ( this , argv ) } for ( i = 0 ; i < len ; i ++ ) { Emitter . nextTick ( fire . bind ( this , listeners [ i ] , argv ) ) } return true }
Execute each of the listeners in order
with the supplied arguments
@param  {String}  type
@return {Boolean}
Execute each of the listeners in order with the supplied arguments