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:
parent
a29b6cd921
commit
18ddb1da38
@ -395,6 +395,12 @@ MaybeLocal<Value> StartExecution(Environment* env, const char* main_script_id) {
|
|||||||
->GetFunction(env->context())
|
->GetFunction(env->context())
|
||||||
.ToLocalChecked()};
|
.ToLocalChecked()};
|
||||||
|
|
||||||
|
InternalCallbackScope callback_scope(
|
||||||
|
env,
|
||||||
|
Object::New(env->isolate()),
|
||||||
|
{ 1, 0 },
|
||||||
|
InternalCallbackScope::kSkipAsyncHooks);
|
||||||
|
|
||||||
return scope.EscapeMaybe(
|
return scope.EscapeMaybe(
|
||||||
ExecuteBootstrapper(env, main_script_id, ¶meters, &arguments));
|
ExecuteBootstrapper(env, main_script_id, ¶meters, &arguments));
|
||||||
}
|
}
|
||||||
|
@ -122,14 +122,7 @@ int NodeMainInstance::Run() {
|
|||||||
Context::Scope context_scope(env->context());
|
Context::Scope context_scope(env->context());
|
||||||
|
|
||||||
if (exit_code == 0) {
|
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);
|
env->set_trace_sync_io(env->options()->trace_sync_io);
|
||||||
|
|
||||||
|
@ -341,11 +341,6 @@ void Worker::Run() {
|
|||||||
env_->InitializeInspector(std::move(inspector_parent_handle_));
|
env_->InitializeInspector(std::move(inspector_parent_handle_));
|
||||||
#endif
|
#endif
|
||||||
HandleScope handle_scope(isolate_);
|
HandleScope handle_scope(isolate_);
|
||||||
InternalCallbackScope callback_scope(
|
|
||||||
env_.get(),
|
|
||||||
Object::New(isolate_),
|
|
||||||
{ 1, 0 },
|
|
||||||
InternalCallbackScope::kSkipAsyncHooks);
|
|
||||||
|
|
||||||
if (!env_->RunBootstrapping().IsEmpty()) {
|
if (!env_->RunBootstrapping().IsEmpty()) {
|
||||||
CreateEnvMessagePort(env_.get());
|
CreateEnvMessagePort(env_.get());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user