| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Assume that the `emitter` argument of `EventEmitter.once()` is an `EventEmitter` if `emitter.on` is a function. Refs: nodejs@4b3654e923e7c3c2 Refs: websockets/ws#1795
|
This fixes a breaking change introduced in 9150c4dc72. The EventTarget implementation is still experimental so I don't think |
Sorry, something went wrong.
|
@lpinca note that that PR was added in order to support EventTarget in userland, Node's own EventTarget isn't actually directly exposed to user-land (outside AbortController). |
Sorry, something went wrong.
|
I don't think this use case (of something that behaves like both eventemitter and eventtarget) is common and a quick GitHub search doesn't find interesting results. I am fine with landing this change as semver-patch. Preferring EventTarget makes sense to me - the only thing that might break is NodeEventTarget but that looks fine to me. The biggest difference here is error handling (adding the error event handler to the EventEmitter). |
Sorry, something went wrong.
|
Also fwiw I am fine with this change in master (and not just 12.x) |
Sorry, something went wrong.
|
On master, v15.x, and v14.x it's already like this. See linked refs. |
Sorry, something went wrong.
|
@lpinca Ah lmao, I am the author of that and absolutely forgot about that 😅 |
Sorry, something went wrong.
Sorry, something went wrong.
|
@nodejs/events can we please get one more sign off on this |
Sorry, something went wrong.
|
pinging @nodejs/events can we please get another sign-off here? maybe @mcollina ? |
Sorry, something went wrong.
There was a problem hiding this comment.
lgtm
Sorry, something went wrong.
|
Landed in a211c70e04aa |
Sorry, something went wrong.
Assume that the `emitter` argument of `EventEmitter.once()` is an `EventEmitter` if `emitter.on` is a function. Refs: 4b3654e923e7c3c2 Refs: websockets/ws#1795 PR-URL: #35818 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
| Back | FazBrowse Home | New Git URL |
Assume that the emitter argument of EventEmitter.once() is an
EventEmitter if emitter.on is a function.
Refs: 4b3654e923e7c3c2
Refs: websockets/ws#1795
Checklist