src: move InternalCallbackScope to StartExecution

PR-URL: https://github.com/nodejs/node/pull/31944
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
This commit is contained in:
Shelley Vohr 2020-02-24 19:14:15 -08:00
parent a29b6cd921
commit 18ddb1da38
No known key found for this signature in database
GPG Key ID: F13993A75599653C
3 changed files with 7 additions and 13 deletions

View File

@ -395,6 +395,12 @@ MaybeLocal<Value> StartExecution(Environment* env, const char* main_script_id) {
->GetFunction(env->context())
.ToLocalChecked()};
InternalCallbackScope callback_scope(
env,
Object::New(env->isolate()),
{ 1, 0 },
InternalCallbackScope::kSkipAsyncHooks);
return scope.EscapeMaybe(
ExecuteBootstrapper(env, main_script_id, &parameters, &arguments));
}

View File

@ -122,14 +122,7 @@ int NodeMainInstance::Run() {
Context::Scope context_scope(env->context());
if (exit_code == 0) {
{
InternalCallbackScope callback_scope(
env.get(),
Object::New(isolate_),
{ 1, 0 },
InternalCallbackScope::kSkipAsyncHooks);
LoadEnvironment(env.get());
}
LoadEnvironment(env.get());
env->set_trace_sync_io(env->options()->trace_sync_io);

View File

@ -341,11 +341,6 @@ void Worker::Run() {
env_->InitializeInspector(std::move(inspector_parent_handle_));
#endif
HandleScope handle_scope(isolate_);
InternalCallbackScope callback_scope(
env_.get(),
Object::New(isolate_),
{ 1, 0 },
InternalCallbackScope::kSkipAsyncHooks);
if (!env_->RunBootstrapping().IsEmpty()) {
CreateEnvMessagePort(env_.get());