summaryrefslogtreecommitdiff
path: root/src/node_process_events.cc
diff options
context:
space:
mode:
authorAnna Henningsen <anna@addaleax.net>2019-11-26 17:05:25 +0100
committerAnna Henningsen <anna@addaleax.net>2019-11-28 17:49:11 +0100
commit5b59c248413af4e81a0616286790b3dc718107ef (patch)
tree5b2078e4d515638137ea21814113c4ca7a2b9634 /src/node_process_events.cc
parentf73716d35aa14d4808be2775dc8374db7aa2fed9 (diff)
downloadandroid-node-v8-5b59c248413af4e81a0616286790b3dc718107ef.tar.gz
android-node-v8-5b59c248413af4e81a0616286790b3dc718107ef.tar.bz2
android-node-v8-5b59c248413af4e81a0616286790b3dc718107ef.zip
src: add more `can_call_into_js()` guards
This is in preparation for running native `SetImmediate()` callbacks during shutdown. PR-URL: https://github.com/nodejs/node/pull/30666 Fixes: https://github.com/nodejs/node/issues/30643 Refs: https://github.com/nodejs/node/pull/30374 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'src/node_process_events.cc')
-rw-r--r--src/node_process_events.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/node_process_events.cc b/src/node_process_events.cc
index 440e67d412..0609622662 100644
--- a/src/node_process_events.cc
+++ b/src/node_process_events.cc
@@ -34,6 +34,8 @@ Maybe<bool> ProcessEmitWarningGeneric(Environment* env,
const char* warning,
const char* type,
const char* code) {
+ if (!env->can_call_into_js()) return Just(false);
+
HandleScope handle_scope(env->isolate());
Context::Scope context_scope(env->context());