Skip to content

Commit c0e1e6e

Browse files
codebyteretargos
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 89dc234 commit c0e1e6e

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

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

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

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

0 commit comments

Comments
 (0)