lib/third_party/tracing/base/event_target.js
function(type, handler) {
      if (!this.listeners_)
        this.listeners_ = Object.create(null);
      if (!(type in this.listeners_)) {
        this.listeners_[type] = [handler];
      } else {
        var handlers = this.listeners_[type];
        if (handlers.indexOf(handler) < 0)
          handlers.push(handler);
      }
    }
function(type, handler) {
      if (!this.listeners_)
        this.listeners_ = Object.create(null);
      if (!(type in this.listeners_)) {
        this.listeners_[type] = [handler];
      } else {
        var handlers = this.listeners_[type];
        if (handlers.indexOf(handler) < 0)
          handlers.push(handler);
      }
    }
function ( type , handler ) { if ( ! this . listeners_ ) this . listeners_ = Object . create ( null ) ; if ( ! ( type in this . listeners_ ) ) { this . listeners_ [ type ] = [ handler ] ; } else { var handlers = this . listeners_ [ type ] ; if ( handlers . indexOf ( handler ) < 0 ) handlers . push ( handler ) ; } }
Adds an event listener to the target.
@param {string} type The name of the event.
@param {!Function|{handleEvent:Function}} handler The handler for the
event. This is called when the event is dispatched.
Adds an event listener to the target .