summaryrefslogtreecommitdiff
path: root/lib/events.js
Commit message (Collapse)AuthorAgeFilesLines
* lib: add internal genericNodeError() functionRich Trott2022-04-201-9/+5
| | | | | | | | | There are a few places in lib where `new Error()` is called and then additional properties are attached in various ways. This creates a utility function to generate the errors. PR-URL: https://github.com/nodejs/node/pull/41879 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de>
* lib: add comments to empty catch statementsRich Trott2022-03-141-2/+6
| | | | | | | | | PR-URL: https://github.com/nodejs/node/pull/41831 Backport-PR-URL: https://github.com/nodejs/node/pull/42160 Refs: https://eslint.org/docs/rules/no-empty Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
* domain: pass opts to `EventEmitter.init`Gang Chen2022-03-141-0/+2
| | | | | | | | PR-URL: https://github.com/nodejs/node/pull/41414 Fixes: https://github.com/nodejs/node/issues/41391 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
* events: add EventEmitterAsyncResource to coreJames M Snell2022-01-311-0/+130
| | | | | | | | Signd-off-by: James M Snell <jasnell@gmail.com> PR-URL: https://github.com/nodejs/node/pull/41246 Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
* lib: use consistent types in JSDoc @returnsRich Trott2022-01-311-1/+1
| | | | | | PR-URL: https://github.com/nodejs/node/pull/41089 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
* lib: fix typos in lib code commentsYoshiki2022-01-311-1/+1
| | | | | | | | | PR-URL: https://github.com/nodejs/node/pull/40792 Reviewed-By: Voltrex <mohammadkeyvanzade94@gmail.com> Reviewed-By: Qingyu Deng <i@ayase-lab.com> Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
* events: fix duplicate require which cause performance penaltywwwzbwcom2021-09-221-5/+1
| | | | | | | | | | | | | PR-URL: https://github.com/nodejs/node/pull/39892 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Nitzan Uziely <linkgoron@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Minwoo Jung <nodecorelab@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Zijian Liu <lxxyxzj@gmail.com> Reviewed-By: Qingyu Deng <i@ayase-lab.com>
* typings: add JSDoc typings for eventsVoltrex2021-05-311-3/+120
| | | | | | | | | Added JSDoc typings for the `events` lib module. PR-URL: https://github.com/nodejs/node/pull/38712 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Masashi Hirano <shisama07@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* events: refactor to use primordials in lib/eventsAkhil Marsonya2021-05-311-11/+20
| | | | | | | | | | Replace code that's vulnerable to Prototype Pollution with Primordials. PR-URL: https://github.com/nodejs/node/pull/38117 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* lib: refactor to reuse validatorsRongjian Zhang2021-05-311-8/+3
| | | | | | | | PR-URL: https://github.com/nodejs/node/pull/38608 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Zijian Liu <lxxyxzj@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* events: use nullish coalencing operatorVoltrex2021-05-181-1/+1
| | | | | | | | PR-URL: https://github.com/nodejs/node/pull/38328 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rich Trott <rtrott@gmail.com>
* lib: revert primordials in a hot pathAntoine du Hamel2021-04-191-14/+10
| | | | | | | | | | | | Evidence has shown that use of primordials have sometimes an impact of performance. This commit reverts the changes who are most likely to be responsible for performance regression in the HTTP response path. PR-URL: https://github.com/nodejs/node/pull/38248 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
* lib: use AbortError consistentlyJames M Snell2021-03-131-21/+11
| | | | | | | | | Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: https://github.com/nodejs/node/pull/37715 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
* lib: remove use of array destructuringAntoine du Hamel2021-03-031-1/+1
| | | | | PR-URL: https://github.com/nodejs/node/pull/36818 Reviewed-By: Rich Trott <rtrott@gmail.com>
* lib: add weak event handlersBenjamin Gruenbaum2021-02-061-1/+3
| | | | | | PR-URL: https://github.com/nodejs/node/pull/36607 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gus Caplan <me@gus.host>
* lib: refactor to use validateFunctionZiJian Liu2021-01-271-4/+3
| | | | | | | | | | | add validateFunction and refactor to use validateFunction PR-URL: https://github.com/nodejs/node/pull/37045 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* events: remove error listener on signal abortZiJian Liu2021-01-181-1/+1
| | | | | | | | | | Fixes: https://github.com/nodejs/node/issues/36949 PR-URL: https://github.com/nodejs/node/pull/36969 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
* events: refactor to use optional chainingZiJian Liu2021-01-111-6/+6
| | | | | | | Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com> PR-URL: https://github.com/nodejs/node/pull/36763 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
* events: refactor to use more primordialsAntoine du Hamel2020-12-251-6/+9
| | | | | PR-URL: https://github.com/nodejs/node/pull/36304 Reviewed-By: Rich Trott <rtrott@gmail.com>
* events: add max listener warning for EventTargetJames M Snell2020-11-161-0/+47
| | | | | | | | | Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: https://github.com/nodejs/node/pull/36001 Fixes: https://github.com/nodejs/node/issues/35990 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
* events: getEventListeners staticBenjamin Gruenbaum2020-11-091-1/+25
| | | | | | PR-URL: https://github.com/nodejs/node/pull/35991 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
* lib: use primordials when calling methods of ErrorAntoine du Hamel2020-10-301-2/+2
| | | | | | | | | | This is to unsure that code using those methods won't crash if the methods are deleted in userland. PR-URL: https://github.com/nodejs/node/pull/35837 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Shingo Inoue <leko.noor@gmail.com>
* lib: replace String global with primordialsSebastien Ahkrin2020-10-041-0/+1
| | | | | | | | | | PR-URL: https://github.com/nodejs/node/pull/35397 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Pranshu Srivastava <rexagod@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com> Reviewed-By: Ujjwal Sharma <ryzokuken@disroot.org>
* events: simplify event target agnostic logic in on and onceDenys Otrishko2020-09-111-36/+10
| | | | | | PR-URL: https://github.com/nodejs/node/pull/34997 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
* events: allow use of AbortController with onJames M Snell2020-09-021-1/+27
| | | | | | | | | Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: https://github.com/nodejs/node/pull/34912 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Denys Otrishko <shishugi@gmail.com>
* events: allow use of AbortController with onceJames M Snell2020-08-311-1/+52
| | | | | | | | | | | | Allows an AbortSignal to be passed in to events.once() to cancel waiting on an event. Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: https://github.com/nodejs/node/pull/34911 Reviewed-By: Denys Otrishko <shishugi@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
* events: fix EventTarget supportBenjamin Gruenbaum2020-06-231-35/+49
| | | | | | | | | | | | | | Remove support for multiple arguments (which don't actually work for EventTarget). Use our EventTarget implementation rather than a mock. Refactor `once` code in preparation of `on` using shared code for supporting `on` with `EventTarget`s. Support EventTarget in the `events.on` static method PR-URL: https://github.com/nodejs/node/pull/34015 Reviewed-By: Denys Otrishko <shishugi@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
* events: improve listeners() performanceBrian White2020-06-171-3/+4
| | | | | | | | | | PR-URL: https://github.com/nodejs/node/pull/33863 Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
* events: improve arrayClone performanceBrian White2020-06-081-7/+13
| | | | | | | | | PR-URL: https://github.com/nodejs/node/pull/33774 Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Zeyu Yang <himself65@outlook.com>
* events: variable originalListener is uselessfuxingZhang2020-05-301-4/+1
| | | | | | | | | PR-URL: https://github.com/nodejs/node/pull/33596 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
* tools: enable no-else-return lint ruleLuigi Pinca2020-05-161-2/+1
| | | | | | | | | Refs: https://github.com/nodejs/node/pull/32644 Refs: https://github.com/nodejs/node/pull/32662 PR-URL: https://github.com/nodejs/node/pull/32667 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
* events: fix removeListener for Symbolszfx2020-03-071-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix removeListener when eventName type is 'symbol'. ```js const EventEmitter = require('events'); const myEmitter = new EventEmitter(); const sym = Symbol('symbol'); const fn = () => { }; myEmitter.on(sym, fn); myEmitter.on('removeListener', (...args) => { console.log('removeListener'); console.log(args, args[0] === sym, args[1] === fn); }); myEmitter.removeAllListeners() ``` When the listener's eventName type is 'symbol' and removeListener is called with no parameters, removeListener should be emitted. PR-URL: https://github.com/nodejs/node/pull/31847 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Shelley Vohr <codebytere@gmail.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* events: convert errorMonitor to a normal propertyGerhard Stoebich2020-03-021-6/+1
| | | | | | | | | | | | | | | Convert property errorMonitor to a normal property as non-writable caused unwanted side effects. Refs: https://github.com/nodejs/node/pull/30932#discussion_r379679982 PR-URL: https://github.com/nodejs/node/pull/31848 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matheus Marchini <mat@mmarchini.me> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
* lib: replace use of Error with primordialsSebastien Ahkrin2020-01-041-0/+1
| | | | | | | | | PR-URL: https://github.com/nodejs/node/pull/31163 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
* events: add EventEmitter.on to async iterate over eventsMatteo Collina2019-12-231-0/+104
| | | | | | | | | | Fixes: https://github.com/nodejs/node/issues/27847 PR-URL: https://github.com/nodejs/node/pull/27994 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rich Trott <rtrott@gmail.com>
* lib: improve spelling and grammar in commentDavid Newman2019-12-211-2/+2
| | | | | | | | PR-URL: https://github.com/nodejs/node/pull/31026 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
* events: allow monitoring error eventsGerhard Stoebich2019-12-201-2/+12
| | | | | | | | | | | | | | | | | | | | | | | | Installing an error listener has a side effect that emitted errors are considered as handled. This is quite bad for monitoring/logging tools which tend to be interested in errors but don't want to cause side effects like swallow an exception. There are some workarounds in the wild like monkey patching emit or remit the error if monitoring tool detects that it is the only listener but this is error prone and risky. This PR allows to install a listener to monitor errors with the side effect to consume the error. To avoid conflicts with other events it exports a symbol on EventEmitter which owns this special meaning. Refs: https://github.com/open-telemetry/opentelemetry-js/issues/225 PR-URL: https://github.com/nodejs/node/pull/30932 Refs: https://github.com/open-telemetry/opentelemetry-js/issues/225 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* lib: enforce use of Promise from primordialsMichaël Zasso2019-12-161-0/+1
| | | | | | | | | | | | PR-URL: https://github.com/nodejs/node/pull/30936 Refs: https://github.com/nodejs/node/issues/30697 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
* lib: replace every Symbol.for by SymbolFor primordialsSebastien Ahkrin2019-12-111-1/+2
| | | | | | | PR-URL: https://github.com/nodejs/node/pull/30857 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
* lib: replace var with let/constjens-cappelle2019-12-101-1/+1
| | | | | | | | | PR-URL: https://github.com/nodejs/node/pull/30384 Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Beth Griggs <Bethany.Griggs@uk.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
* lib: replace Symbol global by the primordials SymbolSebastien Ahkrin2019-12-081-0/+1
| | | | | | | | | PR-URL: https://github.com/nodejs/node/pull/30737 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
* events: add captureRejection optionMatteo Collina2019-12-031-6/+106
| | | | | | | | | PR-URL: https://github.com/nodejs/node/pull/27867 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michaël Zasso <targos@protonmail.com>
* lib: use static Number properties from primordialsMichaël Zasso2019-11-301-2/+3
| | | | | | PR-URL: https://github.com/nodejs/node/pull/30686 Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
* lib: enforce use of Array from primordialsMichaël Zasso2019-11-271-0/+1
| | | | | | | PR-URL: https://github.com/nodejs/node/pull/30635 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
* lib: replace var with let/constjens-cappelle2019-11-261-11/+11
| | | | | | | | | | PR-URL: https://github.com/nodejs/node/pull/30391 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
* lib: flatten access to primordialsMichaël Zasso2019-11-251-13/+7
| | | | | | | | | | | | | | Store all primordials as properties of the primordials object. Static functions are prefixed by the constructor's name and prototype methods are prefixed by the constructor's name followed by "Prototype". For example: primordials.Object.keys becomes primordials.ObjectKeys. PR-URL: https://github.com/nodejs/node/pull/30610 Refs: https://github.com/nodejs/node/issues/29766 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
* events: improve performance caused by primordialsguzhizhou2019-11-221-16/+29
| | | | | | | | | | | PR-URL: https://github.com/nodejs/node/pull/30577 Refs: https://github.com/nodejs/code-and-learn/issues/97 Refs: https://github.com/nodejs/node/issues/29766 Refs: https://github.com/nodejs/node/pull/29633 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
* events: improve performance of EventEmitter.emitMatteo Collina2019-09-241-2/+3
| | | | | | | | | | | | | | | This restore some performance we lost when we introduced primordialias. Improvements are up to +100%. PR-URL: https://github.com/nodejs/node/pull/29633 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
* events: add support for EventTarget in onceJenia2019-09-221-0/+11
| | | | | | | | | PR-URL: https://github.com/nodejs/node/pull/29498 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
* events: improve once() performanceBrian White2019-08-271-2/+4
| | | | | | | | | | PR-URL: https://github.com/nodejs/node/pull/29307 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>