[addEventListener Adds event listener to the timer]
@param {string} event      [event to listen]
@param {function} listener   [the event listener function]
9832
function addEventListener (event, listener) {
    if (hasDOM()) {
      eventEmitter.addEventListener(event, listener);
    } else if (hasEventEmitter()) {
      eventEmitter.on(event, listener);
    }
  }
238895
function listenersHelp (element, events, handler, method) {
  let list = events.split(' ')
  for (let i = 0, len = list.length; i < len; i++) {
    let item = list[i]
    if (method === false) {
      element.removeEventListener(item, handler)
    } else {
      element.addEventListener(item, handler, false)
    }
  }
}
737991
function addEvent(elem, event, fn) {
  if (elem.addEventListener) {
    elem.addEventListener(event, fn, false);
    return fn;
  } else {
    let fn2 = function() {
      // set the this pointer same as addEventListener when fn is called
      return(fn.call(elem, window.event));
    };
    elem.attachEvent("on" + event, fn2);
    return fn2;
  }
}
437817
public function addListener(string $event, $listener)
    {
        if (!isset($this->listeners[$event])) {
            $this->listeners[$event] = [];
        }
        $this->listeners[$event][] = $listener;
    }
658393
function (listener, prepend) {
			if ('function' === typeof listener)
			{
				var self = this,
					g = function (e)
					{
						e.lastListeners--;
						self.removeListener(g);
						listener.apply(listener, arguments);
					};
				g.listener = listener;
				
				this.addListener(g,prepend)
			}
			return this;
		}
760223
function appendListener(event, listener, once) {

    this.events[event] = this.events[event] || [];
    this.events[event].push({
      "listener": listener,
      "once": !!once
    });

    this.emit('newListener', event, listener);

    if (this.events[event].length > this.maxListeners) {

      console.warn('warning: possible EventEmitter memory leak detected. ',
        this.events[event].length, ' listeners added. ',
        'Use emitter.setMaxListeners() to increase limit. ',
        this);

    }

  }
360704
function(object, events) {
        if (!object.__isInterfaceImplemented('events')) {
            object.__implementInterface('events', this.interface);
        }

        object.__initEvents();

        _.each(events, function(eventListeners, eventName) {
            _.each(eventListeners, function(listener, listenerName) {
                object.__addEventListener(eventName, listenerName, listener);
            });
        });
    }
1004751
synchronized void addListener(final AbstractEventListener<?> listener) {
        if (null == listener) {
            throw new NullPointerException();
        }

        final String eventType = listener.getEventType();
        if (null == eventType) {
            throw new NullPointerException();
        }

        List<AbstractEventListener<?>> listenerList = listeners.get(eventType);
        if (null == listenerList) {
            listenerList = new ArrayList<>();
            listeners.put(eventType, listenerList);
        }

        listenerList.add(listener);
    }
492503
function addListener(event, callback) {
    checkEventValid(event);

    if (listeners[event]) {
        listeners[event].push(callback);
    } else {
        listeners[event] = [callback];
    }
}
241399
function addListener(event, callback, meta) {
  event.listeners.push(callback);
  event.meta.set(callback, meta);
}
632264
public synchronized void addEventListener(EventListener listener) throws IllegalArgumentException
    {
        if (listener instanceof ServletContextListener)
        {
            _contextListeners= LazyList.add(_contextListeners, listener);
        }
 
        super.addEventListener(listener);
    }
301901
public function addListener($event, $method)
    {
        if (!isset($this->listeners[$event])) {
            $this->listeners[$event] = array();
        }

        $this->listeners[$event][] = $method;
    }
494309
function addEvent(o,e,f){
	if (o.addEventListener){ o.addEventListener(e,f,false); return true; }
	else if (o.attachEvent){ return o.attachEvent("on"+e,f); }
	else { return false; }
}
773522
function(eventName, listener) {
			if (typeof listener === "function" || listener.handleEvent) {
				this._namedListeners[eventName] = this._namedListeners[eventName] || [];
				this._namedListeners[eventName].push(listener);
			}
		}
1172525
public function addListenerForEvent($eventClassName, $listener)
    {
        if (FALSE === array_key_exists($eventClassName, $this->eventMap))
        {
            $this->eventMap[$eventClassName] = [];
        }
        $this->eventMap[$eventClassName][] = $listener;
    }
915287
function(listener) {
  // Check that listener has the required functions
  var events = ['comment', 'tag', 'feature', 'background', 'scenario', 'scenario_outline', 'examples', 'step', 'doc_string', 'row', 'eof'];
  for(var i=0, len=events.length; i<len; i++) {
    var event = events[i];
    if(typeof listener[event] != 'function') {
      throw new Error("Error. No " + event + " function exists on " + JSON.stringify(listener));
    }
  }
  this.listener = listener;
}
1305305
function addEventListener(node, type, handler, capture) {
		if (typeof node.addEventListener === "function") { //$NON-NLS-0$
			node.addEventListener(type, handler, capture === true);
		} else {
			node.attachEvent("on" + type, handler); //$NON-NLS-0$
		}
	}