From ce3a7cb102f35aa235224004e71c23ddd2907cac Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Wed, 27 May 2020 11:50:22 -0700 Subject: [PATCH] Fixup InternalCallbackScope patch https://github.com/nodejs/node/pull/30959 --- patches/node/fix_expose_internalcallbackscope.patch | 2 +- shell/app/node_main.cc | 5 ++--- shell/common/api/electron_bindings.cc | 6 +++--- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/patches/node/fix_expose_internalcallbackscope.patch b/patches/node/fix_expose_internalcallbackscope.patch index c16a957c342e4..8d3092394aab4 100644 --- a/patches/node/fix_expose_internalcallbackscope.patch +++ b/patches/node/fix_expose_internalcallbackscope.patch @@ -3,7 +3,7 @@ From: deepak1556 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 diff --git a/shell/app/node_main.cc b/shell/app/node_main.cc index bc1257758b13f..2122ac23418b9 100644 --- a/shell/app/node_main.cc +++ b/shell/app/node_main.cc @@ -238,9 +238,8 @@ int NodeMain(int argc, char* argv[]) { { v8::HandleScope scope(isolate); node::InternalCallbackScope callback_scope( - env, v8::Local(), {1, 0}, - node::InternalCallbackScope::kAllowEmptyResource | - node::InternalCallbackScope::kSkipAsyncHooks); + env, v8::Object::New(isolate), {1, 0}, + node::InternalCallbackScope::kSkipAsyncHooks); node::LoadEnvironment(env); } diff --git a/shell/common/api/electron_bindings.cc b/shell/common/api/electron_bindings.cc index 0b23950f91570..fed4a102b5759 100644 --- a/shell/common/api/electron_bindings.cc +++ b/shell/common/api/electron_bindings.cc @@ -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(), {0, 0}, - node::InternalCallbackScope::kAllowEmptyResource); + node::InternalCallbackScope scope(env, v8::Object::New(env->isolate()), + {0, 0}, + node::InternalCallbackScope::kNoFlags); } self->pending_next_ticks_.clear();