-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
feat: add "unhandledrejection" event support #12994
Conversation
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.
Thanks for doing this, Bartek! The test failures are probably (hopefully) a small matter of updating test expectations.
// TODO(lucacasonato): remove when this interface is spec aligned | ||
[SymbolToStringTag] = "PromiseRejectionEvent"; |
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.
For my understanding: what is the misalignment here? cc @lucacasonato
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.
The entire eventing system has not been migrated to use our webidl helper classes yet. It is on my backburner.
I think there's quite more to do before this PR will be ready to merge. Just wanted to get ball rolling for now. |
Discussed with @bnoordhuis offline, we're punting this PR for now as it's not clear how this functionality would integrate with Node compatibility layer. Ben will first implement |
Does this PR not implement |
It does implement it. |
As a reminder, it is incredibly useful to some people to be able to make sure this can be used to prevent a process from crashing in production. |
What version should we wait for this possibility? |
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions. |
Do you have any plans to merge this submission? |
Yes, but it hasn't been the highest priority. |
OK, I will continue to pay attention to this. Thanks for your reply. |
1af80b2
to
1ed9ee5
Compare
e89ff22
to
482a3f7
Compare
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.
LGTM
25428a0
to
31a108b
Compare
Done |
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.
LGTM!
This reverts commit f7af0b0.
This commit adds support for "unhandledrejection" event. This event will trigger event listeners registered using: "globalThis.addEventListener("unhandledrejection") "globalThis.onunhandledrejection" This is done by registering a default handler using "Deno.core.setPromiseRejectCallback" that allows to handle rejected promises in JavaScript instead of Rust. This commit will make it possible to polyfill "process.on("unhandledRejection")" in the Node compat layer. Co-authored-by: Colin Ihrig <[email protected]>
Relanding #12994 This commit adds support for "unhandledrejection" event. This event will trigger event listeners registered using: "globalThis.addEventListener("unhandledrejection") "globalThis.onunhandledrejection" This is done by registering a default handler using "Deno.core.setPromiseRejectCallback" that allows to handle rejected promises in JavaScript instead of Rust. This commit will make it possible to polyfill "process.on("unhandledRejection")" in the Node compat layer. Co-authored-by: Colin Ihrig <[email protected]>
…denoland#15080)" This reverts commit 1a7259b.
…d#12994) (denoland#15080)" (denoland#15210)" This reverts commit f9b692e.
This commit adds support for "unhandledrejection" event.
This event will trigger event listeners registered using:
This is done by registering a default handler using
"Deno.core.setPromiseRejectCallback" that allows to
handle rejected promises in JavaScript instead of Rust.
This commit will make it possible to polyfill
"process.on("unhandledRejection")" in the Node compat
layer.
Closes #7013