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 authored and Michaël Zasso committed 2020-04-28 16:00:43 +02:00
1 parent b4ca132254
commit ffefb059e2
3 files changed
+7 -13

No files matched your search

+6
View File
@@ -389,6 +389,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));
}
+1 -8
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);
-5
View File
@@ -344,11 +344,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());