-
-
Notifications
You must be signed in to change notification settings - Fork 35.4k
process: refactor promise rejection handling #25200
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
Changes from 1 commit
a9bd4b0
8f78021
bdad2db
4a6765b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Rename `internalTickCallback` to `processTicksAndRejections`, make sure it does not get called if it's not set in C++. - Rename `emitPromiseRejectionWarnings` to `processPromiseRejections` since it also emit events that are not warnings. - Sets `SetPromiseRejectCallback` in the `Environment` constructor to make sure it only gets called once per-isolate, and make sure it does not get called if it's not set in C++. - Wrap promise rejection callback initialization into `listenForRejections()`. - Add comments.
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -241,6 +241,8 @@ Environment::Environment(IsolateData* isolate_data, | |
| if (options_->no_force_async_hooks_checks) { | ||
| async_hooks_.no_force_checks(); | ||
| } | ||
|
|
||
| isolate()->SetPromiseRejectCallback(task_queue::PromiseRejectCallback); | ||
|
Member
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. Can you leave a TODO comment for me? We’re letting a single
Member
Author
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. Out of curiosity - when would multiple |
||
| } | ||
|
|
||
| Environment::~Environment() { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.