Prepend a new listener to the event, if it exists
@param string $eventName event name
@param function $handler event handler
@return this
544461
function (eventName,handler) {
			var event;
			if (event = this.getEvent(eventName))
			{
				if (!event.prependListener(handler))
					this.e.log('Invalid handler sent to event `'+eventName+'` on `'+this.getConfig('id')+'`','warning');
			} else
				this.e.log('Not existent event `'+eventName+'` on `'+this.getConfig('id')+'`','warning');
			return this;
		}
331246
function addEventListener(el, eventName, handler) {
    removeEventListener(el, eventName, handler);

    if (window.jQuery) {
      $(el).on(eventName, handler);
    } else if (el.addEventListener) {
      el.addEventListener(eventName, handler);
    } else {
      el.attachEvent('on' + eventName, function () {
        handler.call(el);
      });
    }
  }
636767
@Override
	public void addEventHandler(EventHandler eventHandler) {
		Preconditions.checkNotNull(eventHandler.getName(), "Missing Name");
		if(getEventHandler(eventHandler.getName()) != null) {
			throw new ApplicationException(Code.CONFLICT, "EventHandler with name " + eventHandler.getName() + " already exists!");
		}
		index(eventHandler);
		dynoClient.hset(nsKey(EVENT_HANDLERS), eventHandler.getName(), toJson(eventHandler));
		recordRedisDaoRequests("addEventHandler");
	}
1157157
public function addListener($eventName, $object, $method = null)
    {
        $this->dispatcher->addListener($eventName, [$object, $method]);

        return $this;
    }
650702
public function addEventListener(string $name, callable $listener): self
    {
        if (!isset($this->internalEventListenersData[$name])) {
            $this->internalEventListenersData[$name] = [];
        }
        $this->internalEventListenersData[$name][] = $listener;
        return $this;
    }
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;
		}
1035040
public function detach($eventName, callable $handler)
    {
        if (isset($this->events[$eventName])) {
            $this->events[$eventName]->remove($handler);
            if (0 == count($this->events[$eventName])) {
                unset($this->events[$eventName]);
            }
        }
    }
820302
def _attach_handler_events(self, handler, events=None):
        
        if not events:
            events = self
        for name in events:
            meth = getattr(handler, name, None)
            if meth:
                self.events[name] += meth
369172
public function instantiate(string $handler) : EventHandler
    {
        $handler = ltrim($handler, '\\');
        if (false === $this->container->has($handler)) {
            throw new InvalidArgumentException(
                sprintf('Handler %s could not be found. Did you register it?', $handler)
            );
        }

        return $this->container->get($handler);
    }
991692
public function addHandler(Handler $handler, $getsPrevious = true, $prepend = false)
    {
        foreach ($this->handlers as $level => $handlers) {
            if ($handler->accepts($level)) {
                if ($prepend) {
                    array_unshift($this->handlers[$level], $handler);
                } else {
                    array_push($this->handlers[$level], $handler);
                }
            }
        }
        if ($getsPrevious) {
            $records = array();
            foreach ($this->log as $record) {
                if ($handler->accepts($record['level'])) {
                    $records[] = $record;
                }
            }
            if (count($records)) {
                $handler->handleBatch($records);
            }
        }
    }
1170649
public function onBefore($event, callable $listener)
    {

        if (strpos($event, '*') !== false) {
            $this->beforeAnyListeners[] = $this->toWildcardListener($event, $listener);
            return $this;
        }

        self::parentOnBefore($event, $listener);

        return $this;
    }
1172525
public function addListenerForEvent($eventClassName, $listener)
    {
        if (FALSE === array_key_exists($eventClassName, $this->eventMap))
        {
            $this->eventMap[$eventClassName] = [];
        }
        $this->eventMap[$eventClassName][] = $listener;
    }
1324675
protected function preNotify($listener, $eventName, Event $event)
    {
        if (Events::SUCCESS == $eventName
            && $event instanceof GenericEvent
        ) {
            /*
             * 'ast' argument of 'reflect.success' event is used only by the cache plugin.
             *  Remove it improve performance.
             */
            if (is_array($listener)
                && !$listener[0] instanceof \Bartlett\Reflect\Plugin\CachePlugin
            ) {
                unset($event['ast']);
            }
        }
        return $event;
    }
773522
function(eventName, listener) {
			if (typeof listener === "function" || listener.handleEvent) {
				this._namedListeners[eventName] = this._namedListeners[eventName] || [];
				this._namedListeners[eventName].push(listener);
			}
		}
457459
function (name, handler, options) {
            var _listeners = this.__handlers__[name]||[], _listener;
            var _context = options && options.context;
            if (handler) {
                for (var i = _listeners.length - 1; i >= 0; i--) {
                    _listener = _listeners[i];
                    if (_listener.handler === handler && (!_context || _listener.context === _context )) {
                        this.__handlers__[name].splice(i, 1);
                    }
                }
            }
            else {
                this.__handlers__[name] = [
                    {
                        owner: null,
                        handler: null,
                        context: null
                    }
                ];
            }

            return this;
        }
768588
function(node, eventName, handler) {
        if (this.recognizers[eventName]) {
            this.setupGesture(node, eventName);
        }
        node.addEventListener(eventName, handler);
    }
256642
public function addListener($eventName, $listener, $priority = 0)
    {
        $this->getDispatcher()->addListener($eventName, $listener, $priority);
    }