diff options
author | Anna Henningsen <anna@addaleax.net> | 2019-11-03 15:00:24 +0300 |
---|---|---|
committer | Anna Henningsen <anna@addaleax.net> | 2019-11-06 15:57:55 +0300 |
commit | d80e49d6801501a0f2b93c442d5e425ed6fc73fb (patch) | |
tree | 959211f188647dab675a4980a2c0f65b9a37a34f /src/node_main_instance.cc | |
parent | 369803175307dae7fd6b983d9270619f11bd7214 (diff) |
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_main_instance.cc')
-rw-r--r-- | src/node_main_instance.cc | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/node_main_instance.cc b/src/node_main_instance.cc index 1c1a09280b7..b1e20c2b14d 100644 --- a/src/node_main_instance.cc +++ b/src/node_main_instance.cc @@ -14,6 +14,7 @@ using v8::HandleScope; using v8::Isolate; using v8::Local; using v8::Locker; +using v8::Object; using v8::SealHandleScope; NodeMainInstance::NodeMainInstance(Isolate* isolate, @@ -111,10 +112,13 @@ int NodeMainInstance::Run() { if (exit_code == 0) { { - AsyncCallbackScope callback_scope(env.get()); - env->async_hooks()->push_async_ids(1, 0); + InternalCallbackScope callback_scope( + env.get(), + Local<Object>(), + { 1, 0 }, + InternalCallbackScope::kAllowEmptyResource | + InternalCallbackScope::kSkipAsyncHooks); LoadEnvironment(env.get()); - env->async_hooks()->pop_async_id(1); } env->set_trace_sync_io(env->options()->trace_sync_io); |