Please sign in to comment.
process: make tick callback and promise rejection callback more robust
- 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. PR-URL: #25200 Reviewed-By: Anna Henningsen <firstname.lastname@example.org> Reviewed-By: Ruben Bridgewater <email@example.com> Reviewed-By: James M Snell <firstname.lastname@example.org>
- Loading branch information...
Showing with 50 additions and 32 deletions.
- +9 −11 lib/internal/process/next_tick.js
- +11 −4 lib/internal/process/promises.js
- +8 −2 src/callback_scope.cc
- +4 −0 src/env.cc
- +4 −0 src/node_internals.h
- +8 −9 src/node_task_queue.cc
- +1 −1 test/message/events_unhandled_error_nexttick.out
- +1 −1 test/message/nexttick_throw.out
- +4 −4 test/message/stdin_messages.out