benchmarks/scenarios/ember.js
function sendEvent(obj, eventName, params, actions) {
    if (!actions) {
      var meta = _emberMetalMeta.peekMeta(obj);
      actions = meta && meta.matchingListeners(eventName);
    }

    if (!actions || actions.length === 0) {
      return;
    }

    for (var i = actions.length - 3; i >= 0; i -= 3) {
      // looping in reverse for once listeners
      var target = actions[i];
      var method = actions[i + 1];
      var flags = actions[i + 2];

      if (!method) {
        continue;
      }
      if (flags & _emberMetalMeta_listeners.SUSPENDED) {
        continue;
      }
      if (flags & _emberMetalMeta_listeners.ONCE) {
        removeListener(obj, eventName, target, method);
      }
      if (!target) {
        target = obj;
      }
      if ('string' === typeof method) {
        if (params) {
          _emberMetalUtils.applyStr(target, method, params);
        } else {
          target[method]();
        }
      } else {
        if (params) {
          _emberMetalUtils.apply(target, method, params);
        } else {
          method.call(target);
        }
      }
    }
    return true;
  }
function sendEvent(obj, eventName, params, actions) {
    if (!actions) {
      var meta = _emberMetalMeta.peekMeta(obj);
      actions = meta && meta.matchingListeners(eventName);
    }

    if (!actions || actions.length === 0) {
      return;
    }

    for (var i = actions.length - 3; i >= 0; i -= 3) {
      // looping in reverse for once listeners
      var target = actions[i];
      var method = actions[i + 1];
      var flags = actions[i + 2];

      if (!method) {
        continue;
      }
      if (flags & _emberMetalMeta_listeners.SUSPENDED) {
        continue;
      }
      if (flags & _emberMetalMeta_listeners.ONCE) {
        removeListener(obj, eventName, target, method);
      }
      if (!target) {
        target = obj;
      }
      if ('string' === typeof method) {
        if (params) {
          _emberMetalUtils.applyStr(target, method, params);
        } else {
          target[method]();
        }
      } else {
        if (params) {
          _emberMetalUtils.apply(target, method, params);
        } else {
          method.call(target);
        }
      }
    }
    return true;
  }
function sendEvent ( obj , eventName , params , actions ) { if ( ! actions ) { var meta = _emberMetalMeta . peekMeta ( obj ) ; actions = meta && meta . matchingListeners ( eventName ) ; } if ( ! actions || actions . length === 0 ) { return ; } for ( var i = actions . length - 3 ; i >= 0 ; i -= 3 ) { // looping in reverse for once listeners var target = actions [ i ] ; var method = actions [ i + 1 ] ; var flags = actions [ i + 2 ] ; if ( ! method ) { continue ; } if ( flags & _emberMetalMeta_listeners . SUSPENDED ) { continue ; } if ( flags & _emberMetalMeta_listeners . ONCE ) { removeListener ( obj , eventName , target , method ) ; } if ( ! target ) { target = obj ; } if ( 'string' === typeof method ) { if ( params ) { _emberMetalUtils . applyStr ( target , method , params ) ; } else { target [ method ] ( ) ; } } else { if ( params ) { _emberMetalUtils . apply ( target , method , params ) ; } else { method . call ( target ) ; } } } return true ; }
Send an event. The execution of suspended listeners
is skipped, and once listeners are removed. A listener without
a target is executed on the passed object. If an array of actions
is not passed, the actions stored on the passed object are invoked.

@method sendEvent
@for Ember
@param obj
@param {String} eventName
@param {Array} params Optional parameters for each listener.
@param {Array} actions Optional array of actions (listeners).
@return true
@public
Send an event . The execution of suspended listeners is skipped and once listeners are removed . A listener without a target is executed on the passed object . If an array of actions is not passed the actions stored on the passed object are invoked .