Skip to content

Commit 3497370

Browse files
committedFeb 27, 2020
src: move InternalCallbackScope to StartExecution
PR-URL: #31944 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Stephen Belanger <admin@stephenbelanger.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
1 parent ca44071 commit 3497370

File tree

3 files changed

+7
-13
lines changed

3 files changed

+7
-13
lines changed
 

‎src/node.cc

+6
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

+1-8
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

-5
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)
Please sign in to comment.