diff options
author | Anna Henningsen <anna@addaleax.net> | 2019-11-03 15:00:24 +0300 |
---|---|---|
committer | Myles Borins <mylesborins@google.com> | 2019-11-17 10:59:08 +0300 |
commit | e3371f0c93b7f3fa66381aad393cc4b5eb9b9dca (patch) | |
tree | 8ddba79e0c0c0a27da87f29d9af6cd4661abdb81 /src/node_worker.cc | |
parent | 8fe684961b6de567acbb85bbf87e60f8ec578376 (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_worker.cc')
-rw-r--r-- | src/node_worker.cc | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/node_worker.cc b/src/node_worker.cc index c79968bad90..c18af7c055e 100644 --- a/src/node_worker.cc +++ b/src/node_worker.cc @@ -347,8 +347,13 @@ void Worker::Run() { inspector_started = true; #endif HandleScope handle_scope(isolate_); - 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); + if (!env_->RunBootstrapping().IsEmpty()) { CreateEnvMessagePort(env_.get()); if (is_stopped()) return; @@ -356,8 +361,6 @@ void Worker::Run() { USE(StartExecution(env_.get(), "internal/main/worker_thread")); } - env_->async_hooks()->pop_async_id(1); - Debug(this, "Loaded environment for worker %llu", thread_id_); } |