summaryrefslogtreecommitdiff
path: root/src/env-inl.h
diff options
context:
space:
mode:
authorAnna Henningsen <anna@addaleax.net>2017-09-20 14:43:19 +0200
committerAnna Henningsen <anna@addaleax.net>2018-05-10 14:15:17 +0200
commitbcb324c3ffd74147041cf892a0b2840aa340c248 (patch)
treedd5c72e9c70ad18f8853d0f0a0a1781ad8e97e5d /src/env-inl.h
parent61fd027096c0416a6e9bbe3ee7b7edb4c180725a (diff)
downloadandroid-node-v8-bcb324c3ffd74147041cf892a0b2840aa340c248.tar.gz
android-node-v8-bcb324c3ffd74147041cf892a0b2840aa340c248.tar.bz2
android-node-v8-bcb324c3ffd74147041cf892a0b2840aa340c248.zip
src: add can_call_into_js flag
This prevents calls back into JS from the shutdown phase. Many thanks for Stephen Belanger for reviewing the original version of this commit in the Ayo.js project. Refs: https://github.com/ayojs/ayo/pull/82 PR-URL: https://github.com/nodejs/node/pull/19377 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'src/env-inl.h')
-rw-r--r--src/env-inl.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/env-inl.h b/src/env-inl.h
index f115656353..0268879f5c 100644
--- a/src/env-inl.h
+++ b/src/env-inl.h
@@ -559,6 +559,14 @@ void Environment::SetUnrefImmediate(native_immediate_callback cb,
CreateImmediate(cb, data, obj, false);
}
+inline bool Environment::can_call_into_js() const {
+ return can_call_into_js_;
+}
+
+inline void Environment::set_can_call_into_js(bool can_call_into_js) {
+ can_call_into_js_ = can_call_into_js;
+}
+
inline performance::performance_state* Environment::performance_state() {
return performance_state_.get();
}