Skip to content

Commit

Permalink
src: move InternalCallbackScope to StartExecution
Browse files Browse the repository at this point in the history
PR-URL: #31944
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
  • Loading branch information
codebytere authored and targos committed Apr 28, 2020
1 parent b4ca132 commit ffefb05
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 13 deletions.
6 changes: 6 additions & 0 deletions src/node.cc
Expand Up @@ -389,6 +389,12 @@ MaybeLocal<Value> StartExecution(Environment* env, const char* main_script_id) {
->GetFunction(env->context())
.ToLocalChecked()};

InternalCallbackScope callback_scope(
env,
Object::New(env->isolate()),
{ 1, 0 },
InternalCallbackScope::kSkipAsyncHooks);

return scope.EscapeMaybe(
ExecuteBootstrapper(env, main_script_id, &parameters, &arguments));
}
Expand Down
9 changes: 1 addition & 8 deletions src/node_main_instance.cc
Expand Up @@ -122,14 +122,7 @@ int NodeMainInstance::Run() {
Context::Scope context_scope(env->context());

if (exit_code == 0) {
{
InternalCallbackScope callback_scope(
env.get(),
Object::New(isolate_),
{ 1, 0 },
InternalCallbackScope::kSkipAsyncHooks);
LoadEnvironment(env.get());
}
LoadEnvironment(env.get());

env->set_trace_sync_io(env->options()->trace_sync_io);

Expand Down
5 changes: 0 additions & 5 deletions src/node_worker.cc
Expand Up @@ -344,11 +344,6 @@ void Worker::Run() {
env_->InitializeInspector(std::move(inspector_parent_handle_));
#endif
HandleScope handle_scope(isolate_);
InternalCallbackScope callback_scope(
env_.get(),
Object::New(isolate_),
{ 1, 0 },
InternalCallbackScope::kSkipAsyncHooks);

if (!env_->RunBootstrapping().IsEmpty()) {
CreateEnvMessagePort(env_.get());
Expand Down

0 comments on commit ffefb05

Please sign in to comment.