Skip to content

Commit

Permalink
Fixup InternalCallbackScope patch
Browse files Browse the repository at this point in the history
  • Loading branch information
codebytere authored and John Kleinschmidt committed Jun 9, 2020
1 parent 5a8750f commit ce3a7cb
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion patches/node/fix_expose_internalcallbackscope.patch
Expand Up @@ -3,7 +3,7 @@ From: deepak1556 <hop2deep@gmail.com>
Date: Sat, 6 Jan 2018 18:28:10 +0530
Subject: fix: expose InternalCallbackScope

This commit exposes InternalCallbackScope in order to allow us access to kAllowEmptyResource for usage https://github.com/electron/electron/blob/master/atom/common/api/atom_bindings.cc\#L108. We should look to accomplish this another way so we no longer need to do this, as in verbose mode the regular CallBack Scope doesn't swallow errors and so we can otherwise use it.
This commit exposes InternalCallbackScope in order to allow us access to its internal flags.

diff --git a/src/node_internals.h b/src/node_internals.h
index 7ec3eac697e4b7d6160da59df709f416814e1f73..c362485dca561ed4a5210d7ac9f0e3b2a36a8d0c 100644
Expand Down
5 changes: 2 additions & 3 deletions shell/app/node_main.cc
Expand Up @@ -238,9 +238,8 @@ int NodeMain(int argc, char* argv[]) {
{
v8::HandleScope scope(isolate);
node::InternalCallbackScope callback_scope(
env, v8::Local<v8::Object>(), {1, 0},
node::InternalCallbackScope::kAllowEmptyResource |
node::InternalCallbackScope::kSkipAsyncHooks);
env, v8::Object::New(isolate), {1, 0},
node::InternalCallbackScope::kSkipAsyncHooks);
node::LoadEnvironment(env);
}

Expand Down
6 changes: 3 additions & 3 deletions shell/common/api/electron_bindings.cc
Expand Up @@ -131,9 +131,9 @@ void ElectronBindings::OnCallNextTick(uv_async_t* handle) {
node::Environment* env = *it;
gin_helper::Locker locker(env->isolate());
v8::Context::Scope context_scope(env->context());
node::InternalCallbackScope scope(
env, v8::Local<v8::Object>(), {0, 0},
node::InternalCallbackScope::kAllowEmptyResource);
node::InternalCallbackScope scope(env, v8::Object::New(env->isolate()),
{0, 0},
node::InternalCallbackScope::kNoFlags);
}

self->pending_next_ticks_.clear();
Expand Down

0 comments on commit ce3a7cb

Please sign in to comment.