Skip to content

Commit 18ddb1d

Browse files
committed
src: move InternalCallbackScope to StartExecution
PR-URL: #31944 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Stephen Belanger <[email protected]> Reviewed-By: Joyee Cheung <[email protected]>
1 parent a29b6cd commit 18ddb1d

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
@@ -395,6 +395,12 @@ MaybeLocal<Value> StartExecution(Environment* env, const char* main_script_id) {
395395
->GetFunction(env->context())
396396
.ToLocalChecked()};
397397

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

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)