lib/third_party/tracing/base/event_target.js
function(event) {
      if (!this.listeners_)
        return true;

      // Since we are using DOM Event objects we need to override some of the
      // properties and methods so that we can emulate this correctly.
      var self = this;
      event.__defineGetter__('target', function() {
        return self;
      });
      var realPreventDefault = event.preventDefault;
      event.preventDefault = function() {
        realPreventDefault.call(this);
        this.rawReturnValue = false;
      };

      var type = event.type;
      var prevented = 0;
      if (type in this.listeners_) {
        // Clone to prevent removal during dispatch
        var handlers = this.listeners_[type].concat();
        for (var i = 0, handler; handler = handlers[i]; i++) {
          if (handler.handleEvent)
            prevented |= handler.handleEvent.call(handler, event) === false;
          else
            prevented |= handler.call(this, event) === false;
        }
      }

      return !prevented && event.rawReturnValue;
    }
function(event) {
      if (!this.listeners_)
        return true;

      // Since we are using DOM Event objects we need to override some of the
      // properties and methods so that we can emulate this correctly.
      var self = this;
      event.__defineGetter__('target', function() {
        return self;
      });
      var realPreventDefault = event.preventDefault;
      event.preventDefault = function() {
        realPreventDefault.call(this);
        this.rawReturnValue = false;
      };

      var type = event.type;
      var prevented = 0;
      if (type in this.listeners_) {
        // Clone to prevent removal during dispatch
        var handlers = this.listeners_[type].concat();
        for (var i = 0, handler; handler = handlers[i]; i++) {
          if (handler.handleEvent)
            prevented |= handler.handleEvent.call(handler, event) === false;
          else
            prevented |= handler.call(this, event) === false;
        }
      }

      return !prevented && event.rawReturnValue;
    }
function ( event ) { if ( ! this . listeners_ ) return true ; // Since we are using DOM Event objects we need to override some of the // properties and methods so that we can emulate this correctly. var self = this ; event . __defineGetter__ ( 'target' , function ( ) { return self ; } ) ; var realPreventDefault = event . preventDefault ; event . preventDefault = function ( ) { realPreventDefault . call ( this ) ; this . rawReturnValue = false ; } ; var type = event . type ; var prevented = 0 ; if ( type in this . listeners_ ) { // Clone to prevent removal during dispatch var handlers = this . listeners_ [ type ] . concat ( ) ; for ( var i = 0 , handler ; handler = handlers [ i ] ; i ++ ) { if ( handler . handleEvent ) prevented |= handler . handleEvent . call ( handler , event ) === false ; else prevented |= handler . call ( this , event ) === false ; } } return ! prevented && event . rawReturnValue ; }
Dispatches an event and calls all the listeners that are listening to
the type of the event.
@param {!cr.event.Event} event The event to dispatch.
@return {boolean} Whether the default action was prevented. If someone
calls preventDefault on the event object then this returns false.
Dispatches an event and calls all the listeners that are listening to the type of the event .