Skip to content

Commit

Permalink
src: use unqualified names in node_contextify.cc
Browse files Browse the repository at this point in the history
This commit removes the usage of qualified names for consistency.

PR-URL: #20669
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
danbev authored and addaleax committed May 14, 2018
1 parent 512982c commit e732b4c
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/node_contextify.cc
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,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 @@ -103,7 +104,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 @@ -420,7 +421,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 @@ -453,13 +454,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

0 comments on commit e732b4c

Please sign in to comment.