-
Notifications
You must be signed in to change notification settings - Fork 29.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
events: change EventTarget handler exception behavior #37237
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -178,14 +178,16 @@ let asyncTest = Promise.resolve(); | |
} | ||
|
||
{ | ||
const uncaughtException = common.mustCall((err, event) => { | ||
const uncaughtException = common.mustCall((err, origin) => { | ||
strictEqual(err.message, 'boom'); | ||
strictEqual(event.type, 'foo'); | ||
strictEqual(origin, 'uncaughtException'); | ||
}, 4); | ||
|
||
// Whether or not the handler function is async or not, errors | ||
// are routed to uncaughtException | ||
process.on('error', uncaughtException); | ||
// Make sure that we no longer call 'error' on error. | ||
process.on('error', common.mustNotCall()); | ||
// Don't call rejection even for async handlers. | ||
process.on('unhandledRejection', common.mustNotCall()); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I suspect we need (in a future PR) something like There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ( and then possibly to remove the |
||
process.on('uncaughtException', uncaughtException); | ||
|
||
const eventTarget = new EventTarget(); | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need the same stack trace enhancing machinery used in
events.js
here?