MCPcopy Index your code
hub / github.com/nodejs/node / on

Method on

lib/internal/event_target.js:979–984  ·  view source on GitHub ↗

* @param {string} type * @param {EventTargetCallback|EventListener} listener * @returns {NodeEventTarget}

(type, listener)

Source from the content-addressed store, hash-verified

977 * @returns {NodeEventTarget}
978 */
979 on(type, listener) {
980 if (!isNodeEventTarget(this))
981 throw new ERR_INVALID_THIS('NodeEventTarget');
982 this.addEventListener(type, listener, { [kIsNodeStyleListener]: true });
983 return this;
984 }
985
986 /**
987 * @param {string} type

Callers 15

parserOnIncomingClientFunction · 0.45
tickOnSocketFunction · 0.45
listenSocketTimeoutFunction · 0.45
_http_client.jsFile · 0.45
SocketFunction · 0.45
ServerFunction · 0.45
_http_outgoing.jsFile · 0.45
SocketFunction · 0.45
dgram.jsFile · 0.45
zlibBufferFunction · 0.45
processChunkSyncFunction · 0.45
constructorMethod · 0.45

Calls 2

isNodeEventTargetFunction · 0.85
addEventListenerMethod · 0.65

Tested by

no test coverage detected