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 <[email protected]>
Reviewed-By: Stephen Belanger <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
  • Loading branch information
codebytere committed Feb 27, 2020
1 parent a29b6cd commit 18ddb1d
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
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
Expand Up @@ -341,11 +341,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 18ddb1d

Please sign in to comment.