Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

src: replace autos in node_contextify.cc #38644

Closed
wants to merge 3 commits into from
Closed
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 6 additions & 5 deletions src/node_contextify.cc
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,8 @@ void ContextifyContext::MakeContext(const FunctionCallbackInfo<Value>& args) {
}

TryCatchScope try_catch(env);
auto context_ptr = std::make_unique<ContextifyContext>(env, sandbox, options);
std::unique_ptr<ContextifyContext> context_ptr =
std::make_unique<ContextifyContext>(env, sandbox, options);

if (try_catch.HasCaught()) {
if (!try_catch.HasTerminated())
Expand Down Expand Up @@ -396,7 +397,7 @@ void ContextifyContext::PropertySetterCallback(
return;

Local<Context> 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);
Expand Down Expand Up @@ -482,7 +483,7 @@ void ContextifyContext::PropertyDefinerCallback(
Local<Context> context = ctx->context();
Isolate* isolate = context->GetIsolate();

auto attributes = PropertyAttribute::None;
PropertyAttribute attributes = PropertyAttribute::None;
bool is_declared =
ctx->global_proxy()->GetRealNamedPropertyAttributes(context,
property)
Expand All @@ -498,7 +499,7 @@ void ContextifyContext::PropertyDefinerCallback(

Local<Object> sandbox = ctx->sandbox();

auto define_prop_on_sandbox =
std::function<void(PropertyDescriptor*)> define_prop_on_sandbox =
[&] (PropertyDescriptor* desc_for_sandbox) {
if (desc.has_enumerable()) {
desc_for_sandbox->set_enumerable(desc.enumerable());
Expand Down Expand Up @@ -954,7 +955,7 @@ bool ContextifyScript::EvalMachine(Environment* env,
MaybeLocal<Value> result;
bool timed_out = false;
bool received_signal = false;
auto run = [&]() {
std::function<MaybeLocal<Value>()> run = [&]() {
MaybeLocal<Value> result = script->Run(env->context());
if (!result.IsEmpty() && mtask_queue)
mtask_queue->PerformCheckpoint(env->isolate());
Expand Down