Skip to content

Commit

Permalink
src: elevate v8 namespaces for PropertyAttribute
Browse files Browse the repository at this point in the history
PR-URL: #26681
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Beth Griggs <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Yongsheng Zhang <[email protected]>
  • Loading branch information
gengjiawen authored and targos committed Mar 27, 2019
1 parent 6744b8c commit eafbfad
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/fs_event_wrap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ void FSEventWrap::Initialize(Local<Object> target,
FIXED_ONE_BYTE_STRING(env->isolate(), "initialized"),
get_initialized_templ,
Local<FunctionTemplate>(),
static_cast<PropertyAttribute>(ReadOnly | DontDelete | v8::DontEnum));
static_cast<PropertyAttribute>(ReadOnly | DontDelete | DontEnum));

target->Set(env->context(),
fsevent_string,
Expand Down
7 changes: 5 additions & 2 deletions src/node_file.cc
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ namespace fs {
using v8::Array;
using v8::BigUint64Array;
using v8::Context;
using v8::DontDelete;
using v8::EscapableHandleScope;
using v8::Float64Array;
using v8::Function;
Expand All @@ -68,6 +69,8 @@ using v8::Number;
using v8::Object;
using v8::ObjectTemplate;
using v8::Promise;
using v8::PropertyAttribute;
using v8::ReadOnly;
using v8::String;
using v8::Symbol;
using v8::Uint32;
Expand Down Expand Up @@ -120,8 +123,8 @@ FileHandle* FileHandle::New(Environment* env, int fd, Local<Object> obj) {
.ToLocal(&obj)) {
return nullptr;
}
v8::PropertyAttribute attr =
static_cast<v8::PropertyAttribute>(v8::ReadOnly | v8::DontDelete);
PropertyAttribute attr =
static_cast<PropertyAttribute>(ReadOnly | DontDelete);
if (obj->DefineOwnProperty(env->context(),
env->fd_string(),
Integer::New(env->isolate(), fd),
Expand Down
7 changes: 5 additions & 2 deletions src/stream_base.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,15 @@ namespace node {
using v8::Array;
using v8::ArrayBuffer;
using v8::Context;
using v8::DontDelete;
using v8::DontEnum;
using v8::External;
using v8::FunctionCallbackInfo;
using v8::HandleScope;
using v8::Integer;
using v8::Local;
using v8::Object;
using v8::ReadOnly;
using v8::String;
using v8::Value;

Expand Down Expand Up @@ -347,8 +350,8 @@ void StreamBase::AddMethod(Environment* env,
void StreamBase::AddMethods(Environment* env, Local<FunctionTemplate> t) {
HandleScope scope(env->isolate());

enum PropertyAttribute attributes = static_cast<PropertyAttribute>(
v8::ReadOnly | v8::DontDelete | v8::DontEnum);
enum PropertyAttribute attributes =
static_cast<PropertyAttribute>(ReadOnly | DontDelete | DontEnum);
Local<Signature> sig = Signature::New(env->isolate(), t);

AddMethod(env, sig, attributes, t, GetFD, env->fd_string());
Expand Down
4 changes: 3 additions & 1 deletion src/udp_wrap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ namespace node {

using v8::Array;
using v8::Context;
using v8::DontDelete;
using v8::FunctionCallbackInfo;
using v8::FunctionTemplate;
using v8::HandleScope;
Expand All @@ -38,6 +39,7 @@ using v8::Local;
using v8::MaybeLocal;
using v8::Object;
using v8::PropertyAttribute;
using v8::ReadOnly;
using v8::Signature;
using v8::String;
using v8::Uint32;
Expand Down Expand Up @@ -98,7 +100,7 @@ void UDPWrap::Initialize(Local<Object> target,
t->SetClassName(udpString);

enum PropertyAttribute attributes =
static_cast<PropertyAttribute>(v8::ReadOnly | v8::DontDelete);
static_cast<PropertyAttribute>(ReadOnly | DontDelete);

Local<Signature> signature = Signature::New(env->isolate(), t);

Expand Down

0 comments on commit eafbfad

Please sign in to comment.