summaryrefslogtreecommitdiff
path: root/src/node_internals.h
diff options
context:
space:
mode:
authorJoyee Cheung <joyeec9h3@gmail.com>2018-12-23 08:45:07 +0800
committerJoyee Cheung <joyeec9h3@gmail.com>2019-01-06 10:28:47 +0800
commitd18b0a01320e392e48f0c475effd8d4db2bb71a8 (patch)
tree91801c7d10b4adc09fe3dbc93cd1c962a7938533 /src/node_internals.h
parentbf566718b29a6fae8cef8d0fecd7e77948726d5a (diff)
downloadandroid-node-v8-d18b0a01320e392e48f0c475effd8d4db2bb71a8.tar.gz
android-node-v8-d18b0a01320e392e48f0c475effd8d4db2bb71a8.tar.bz2
android-node-v8-d18b0a01320e392e48f0c475effd8d4db2bb71a8.zip
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: https://github.com/nodejs/node/pull/25200 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'src/node_internals.h')
-rw-r--r--src/node_internals.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/node_internals.h b/src/node_internals.h
index acc97633ce..4ed75385f9 100644
--- a/src/node_internals.h
+++ b/src/node_internals.h
@@ -180,6 +180,10 @@ SlicedArguments::SlicedArguments(
size_ = size;
}
+namespace task_queue {
+void PromiseRejectCallback(v8::PromiseRejectMessage message);
+} // namespace task_queue
+
v8::Maybe<bool> ProcessEmitWarning(Environment* env, const char* fmt, ...);
v8::Maybe<bool> ProcessEmitDeprecationWarning(Environment* env,
const char* warning,