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: use unqualified names in node_contextify.cc #20669

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
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 @@ -64,6 +64,7 @@ using v8::Uint8Array;
using v8::UnboundScript;
using v8::Value;
using v8::WeakCallbackInfo;
using v8::WeakCallbackType;

// The vm module executes code in a sandboxed environment with a different
// global object than the rest of the code. This is achieved by applying
Expand Down Expand Up @@ -104,7 +105,7 @@ ContextifyContext::ContextifyContext(
// Allocation failure or maximum call stack size reached
if (context_.IsEmpty())
return;
context_.SetWeak(this, WeakCallback, v8::WeakCallbackType::kParameter);
context_.SetWeak(this, WeakCallback, WeakCallbackType::kParameter);
}


Expand Down Expand Up @@ -421,7 +422,7 @@ void ContextifyContext::PropertyDefinerCallback(
return;

Local<Context> context = ctx->context();
v8::Isolate* isolate = context->GetIsolate();
Isolate* isolate = context->GetIsolate();

auto attributes = PropertyAttribute::None;
bool is_declared =
Expand Down Expand Up @@ -454,13 +455,13 @@ void ContextifyContext::PropertyDefinerCallback(

if (desc.has_get() || desc.has_set()) {
PropertyDescriptor desc_for_sandbox(
desc.has_get() ? desc.get() : v8::Undefined(isolate).As<Value>(),
desc.has_set() ? desc.set() : v8::Undefined(isolate).As<Value>());
desc.has_get() ? desc.get() : Undefined(isolate).As<Value>(),
desc.has_set() ? desc.set() : Undefined(isolate).As<Value>());

define_prop_on_sandbox(&desc_for_sandbox);
} else {
Local<Value> value =
desc.has_value() ? desc.value() : v8::Undefined(isolate).As<Value>();
desc.has_value() ? desc.value() : Undefined(isolate).As<Value>();

if (desc.has_writable()) {
PropertyDescriptor desc_for_sandbox(value, desc.writable());
Expand Down