diff options
author | Anna Henningsen <anna@addaleax.net> | 2019-11-03 13:00:24 +0100 |
---|---|---|
committer | Anna Henningsen <anna@addaleax.net> | 2019-11-06 13:57:55 +0100 |
commit | d80e49d6801501a0f2b93c442d5e425ed6fc73fb (patch) | |
tree | 959211f188647dab675a4980a2c0f65b9a37a34f /src/node_internals.h | |
parent | 369803175307dae7fd6b983d9270619f11bd7214 (diff) | |
download | android-node-v8-d80e49d6801501a0f2b93c442d5e425ed6fc73fb.tar.gz android-node-v8-d80e49d6801501a0f2b93c442d5e425ed6fc73fb.tar.bz2 android-node-v8-d80e49d6801501a0f2b93c442d5e425ed6fc73fb.zip |
src: use callback scope for main script
This allows removing custom code for setting the current async ids
and running nextTicks.
PR-URL: https://github.com/nodejs/node/pull/30236
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'src/node_internals.h')
-rw-r--r-- | src/node_internals.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/node_internals.h b/src/node_internals.h index 2ec230d8b5..106f6613f1 100644 --- a/src/node_internals.h +++ b/src/node_internals.h @@ -203,12 +203,16 @@ v8::MaybeLocal<v8::Value> InternalMakeCallback( class InternalCallbackScope { public: - // Tell the constructor whether its `object` parameter may be empty or not. - enum ResourceExpectation { kRequireResource, kAllowEmptyResource }; + enum Flags { + // Tell the constructor whether its `object` parameter may be empty or not. + kAllowEmptyResource = 1, + // Indicates whether 'before' and 'after' hooks should be skipped. + kSkipAsyncHooks = 2 + }; InternalCallbackScope(Environment* env, v8::Local<v8::Object> object, const async_context& asyncContext, - ResourceExpectation expect = kRequireResource); + int flags = 0); // Utility that can be used by AsyncWrap classes. explicit InternalCallbackScope(AsyncWrap* async_wrap); ~InternalCallbackScope(); @@ -222,6 +226,7 @@ class InternalCallbackScope { async_context async_context_; v8::Local<v8::Object> object_; AsyncCallbackScope callback_scope_; + bool skip_hooks_; bool failed_ = false; bool pushed_ids_ = false; bool closed_ = false; |