From 14142c74f647916cb24c369dfb3613fb4f62a1e6 Mon Sep 17 00:00:00 2001 From: XadillaX Date: Wed, 12 May 2021 15:42:25 +0800 Subject: [PATCH 1/3] src: replace `auto`s in node_contextify.cc --- src/node_contextify.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/node_contextify.cc b/src/node_contextify.cc index 23895382b33c86..d5035f293db2a9 100644 --- a/src/node_contextify.cc +++ b/src/node_contextify.cc @@ -294,7 +294,7 @@ void ContextifyContext::MakeContext(const FunctionCallbackInfo& args) { } TryCatchScope try_catch(env); - auto context_ptr = std::make_unique(env, sandbox, options); + std::unique_ptr context_ptr = std::make_unique(env, sandbox, options); if (try_catch.HasCaught()) { if (!try_catch.HasTerminated()) @@ -396,7 +396,7 @@ void ContextifyContext::PropertySetterCallback( return; Local context = ctx->context(); - auto attributes = PropertyAttribute::None; + PropertyAttribute attributes = PropertyAttribute::None; bool is_declared_on_global_proxy = ctx->global_proxy() ->GetRealNamedPropertyAttributes(context, property) .To(&attributes); @@ -482,7 +482,7 @@ void ContextifyContext::PropertyDefinerCallback( Local context = ctx->context(); Isolate* isolate = context->GetIsolate(); - auto attributes = PropertyAttribute::None; + PropertyAttribute attributes = PropertyAttribute::None; bool is_declared = ctx->global_proxy()->GetRealNamedPropertyAttributes(context, property) @@ -498,7 +498,7 @@ void ContextifyContext::PropertyDefinerCallback( Local sandbox = ctx->sandbox(); - auto define_prop_on_sandbox = + std::function define_prop_on_sandbox = [&] (PropertyDescriptor* desc_for_sandbox) { if (desc.has_enumerable()) { desc_for_sandbox->set_enumerable(desc.enumerable()); @@ -954,7 +954,7 @@ bool ContextifyScript::EvalMachine(Environment* env, MaybeLocal result; bool timed_out = false; bool received_signal = false; - auto run = [&]() { + std::function()> run = [&]() { MaybeLocal result = script->Run(env->context()); if (!result.IsEmpty() && mtask_queue) mtask_queue->PerformCheckpoint(env->isolate()); From 3ae0a3d6432eb623507f6a0581afb8b824e75fdc Mon Sep 17 00:00:00 2001 From: XadillaX Date: Wed, 12 May 2021 15:50:49 +0800 Subject: [PATCH 2/3] f --- src/node_contextify.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/node_contextify.cc b/src/node_contextify.cc index d5035f293db2a9..17f2f2f72e57ca 100644 --- a/src/node_contextify.cc +++ b/src/node_contextify.cc @@ -294,7 +294,8 @@ void ContextifyContext::MakeContext(const FunctionCallbackInfo& args) { } TryCatchScope try_catch(env); - std::unique_ptr context_ptr = std::make_unique(env, sandbox, options); + std::unique_ptr context_ptr = + std::make_unique(env, sandbox, options); if (try_catch.HasCaught()) { if (!try_catch.HasTerminated()) From e2d39981368dd423ed73976fa73a36bd9007b9ff Mon Sep 17 00:00:00 2001 From: XadillaX Date: Thu, 13 May 2021 10:41:09 +0800 Subject: [PATCH 3/3] f --- src/node_contextify.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/node_contextify.cc b/src/node_contextify.cc index 17f2f2f72e57ca..ce25f0545bf68a 100644 --- a/src/node_contextify.cc +++ b/src/node_contextify.cc @@ -499,7 +499,7 @@ void ContextifyContext::PropertyDefinerCallback( Local sandbox = ctx->sandbox(); - std::function define_prop_on_sandbox = + auto define_prop_on_sandbox = [&] (PropertyDescriptor* desc_for_sandbox) { if (desc.has_enumerable()) { desc_for_sandbox->set_enumerable(desc.enumerable()); @@ -955,7 +955,7 @@ bool ContextifyScript::EvalMachine(Environment* env, MaybeLocal result; bool timed_out = false; bool received_signal = false; - std::function()> run = [&]() { + auto run = [&]() { MaybeLocal result = script->Run(env->context()); if (!result.IsEmpty() && mtask_queue) mtask_queue->PerformCheckpoint(env->isolate());