-
-
Notifications
You must be signed in to change notification settings - Fork 33.5k
Closed
Closed
Copy link
Labels
eventsIssues and PRs related to the events subsystem / EventEmitter.Issues and PRs related to the events subsystem / EventEmitter.
Description
- Version:v15.14.0
- Platform:Linux elara 5.4.0-70-generic Mani #78-Ubuntu SMP Fri Mar 19 13:29:52 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
- Subsystem:events
What steps will reproduce the bug?
let t = new EventTarget();
t.addEventListener('foo', evt => { throw new Error("Error thrown by first listener"); });
t.addEventListener('foo', evt => console.log("Second listener received event:", evt));
t.dispatchEvent(new Event('foo'));
console.log("After dispatch");
How often does it reproduce? Is there a required condition?
Always.
What is the expected behavior?
Unless I'm missing something, both calls to console.log should execute. This is what happens in Chrome, Safari, and Firefox (while also calling out the unhandled exception, of course).
What do you see instead?
Node does not print either log message and appears to be allowing the exception to propagate all the way out of dispatchEvent.
Additional information
Metadata
Metadata
Assignees
Labels
eventsIssues and PRs related to the events subsystem / EventEmitter.Issues and PRs related to the events subsystem / EventEmitter.