Skip to content

Commit 0f14c55

Browse files
committed
src: move InternalCallbackScope to StartExecution
1 parent 72b6cea commit 0f14c55

File tree

3 files changed

+7
-13
lines changed

3 files changed

+7
-13
lines changed

src/node.cc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,12 @@ MaybeLocal<Value> StartExecution(Environment* env, const char* main_script_id) {
397397
->GetFunction(env->context())
398398
.ToLocalChecked()};
399399

400+
InternalCallbackScope callback_scope(
401+
env,
402+
Object::New(env->isolate()),
403+
{ 1, 0 },
404+
InternalCallbackScope::kSkipAsyncHooks);
405+
400406
return scope.EscapeMaybe(
401407
ExecuteBootstrapper(env, main_script_id, &parameters, &arguments));
402408
}

src/node_main_instance.cc

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -122,14 +122,7 @@ int NodeMainInstance::Run() {
122122
Context::Scope context_scope(env->context());
123123

124124
if (exit_code == 0) {
125-
{
126-
InternalCallbackScope callback_scope(
127-
env.get(),
128-
Object::New(isolate_),
129-
{ 1, 0 },
130-
InternalCallbackScope::kSkipAsyncHooks);
131-
LoadEnvironment(env.get());
132-
}
125+
LoadEnvironment(env.get());
133126

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

src/node_worker.cc

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -341,11 +341,6 @@ void Worker::Run() {
341341
env_->InitializeInspector(std::move(inspector_parent_handle_));
342342
#endif
343343
HandleScope handle_scope(isolate_);
344-
InternalCallbackScope callback_scope(
345-
env_.get(),
346-
Object::New(isolate_),
347-
{ 1, 0 },
348-
InternalCallbackScope::kSkipAsyncHooks);
349344

350345
if (!env_->RunBootstrapping().IsEmpty()) {
351346
CreateEnvMessagePort(env_.get());

0 commit comments

Comments
 (0)