Skip to content

Commit adc1afb

Browse files
codebyterepuzpuzpuz
authored andcommitted
src: move InternalCallbackScope to StartExecution
PR-URL: nodejs#31944 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Stephen Belanger <[email protected]> Reviewed-By: Joyee Cheung <[email protected]>
1 parent 1f61d3c commit adc1afb

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
@@ -390,6 +390,12 @@ MaybeLocal<Value> StartExecution(Environment* env, const char* main_script_id) {
390390
->GetFunction(env->context())
391391
.ToLocalChecked()};
392392

393+
InternalCallbackScope callback_scope(
394+
env,
395+
Object::New(env->isolate()),
396+
{ 1, 0 },
397+
InternalCallbackScope::kSkipAsyncHooks);
398+
393399
return scope.EscapeMaybe(
394400
ExecuteBootstrapper(env, main_script_id, &parameters, &arguments));
395401
}

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
@@ -343,11 +343,6 @@ void Worker::Run() {
343343
env_->InitializeInspector(std::move(inspector_parent_handle_));
344344
#endif
345345
HandleScope handle_scope(isolate_);
346-
InternalCallbackScope callback_scope(
347-
env_.get(),
348-
Object::New(isolate_),
349-
{ 1, 0 },
350-
InternalCallbackScope::kSkipAsyncHooks);
351346

352347
if (!env_->RunBootstrapping().IsEmpty()) {
353348
CreateEnvMessagePort(env_.get());

0 commit comments

Comments
 (0)