Skip to content

Commit

Permalink
Fix async context timer issue
Browse files Browse the repository at this point in the history
  • Loading branch information
codebytere committed Feb 24, 2020
1 parent 4d72e13 commit e43d713
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion shell/app/node_main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,12 @@ int NodeMain(int argc, char* argv[]) {
node_debugger.Start();

node::BootstrapEnvironment(env);

// TODO(codebytere): we shouldn't have to call this - upstream?
env->InitializeDiagnostics();

// This is needed in order to enable v8 host weakref hooks.
// TODO(codebytere): we shouldn't have to call this - upstream?
gin_env.isolate()->SetHostCleanupFinalizationGroupCallback(
HostCleanupFinalizationGroupCallback);

Expand All @@ -181,7 +184,15 @@ int NodeMain(int argc, char* argv[]) {
versions.SetReadOnly(ELECTRON_PROJECT_NAME, ELECTRON_VERSION_STRING);
}

node::LoadEnvironment(env);
// TODO(codebytere): we should try to handle this upstream.
{
node::InternalCallbackScope callback_scope(
env, v8::Local<v8::Object>(), {1, 0},
node::InternalCallbackScope::kAllowEmptyResource |
node::InternalCallbackScope::kSkipAsyncHooks);
node::LoadEnvironment(env);
}

v8::Isolate* isolate = env->isolate();

{
Expand Down

0 comments on commit e43d713

Please sign in to comment.