Skip to content

Commit eafbfad

Browse files
gengjiawentargos
authored andcommitted
src: elevate v8 namespaces for PropertyAttribute
PR-URL: #26681 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Beth Griggs <Bethany.Griggs@uk.ibm.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
1 parent 6744b8c commit eafbfad

File tree

4 files changed

+14
-6
lines changed

4 files changed

+14
-6
lines changed

src/fs_event_wrap.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ void FSEventWrap::Initialize(Local<Object> target,
118118
FIXED_ONE_BYTE_STRING(env->isolate(), "initialized"),
119119
get_initialized_templ,
120120
Local<FunctionTemplate>(),
121-
static_cast<PropertyAttribute>(ReadOnly | DontDelete | v8::DontEnum));
121+
static_cast<PropertyAttribute>(ReadOnly | DontDelete | DontEnum));
122122

123123
target->Set(env->context(),
124124
fsevent_string,

src/node_file.cc

+5-2
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ namespace fs {
5353
using v8::Array;
5454
using v8::BigUint64Array;
5555
using v8::Context;
56+
using v8::DontDelete;
5657
using v8::EscapableHandleScope;
5758
using v8::Float64Array;
5859
using v8::Function;
@@ -68,6 +69,8 @@ using v8::Number;
6869
using v8::Object;
6970
using v8::ObjectTemplate;
7071
using v8::Promise;
72+
using v8::PropertyAttribute;
73+
using v8::ReadOnly;
7174
using v8::String;
7275
using v8::Symbol;
7376
using v8::Uint32;
@@ -120,8 +123,8 @@ FileHandle* FileHandle::New(Environment* env, int fd, Local<Object> obj) {
120123
.ToLocal(&obj)) {
121124
return nullptr;
122125
}
123-
v8::PropertyAttribute attr =
124-
static_cast<v8::PropertyAttribute>(v8::ReadOnly | v8::DontDelete);
126+
PropertyAttribute attr =
127+
static_cast<PropertyAttribute>(ReadOnly | DontDelete);
125128
if (obj->DefineOwnProperty(env->context(),
126129
env->fd_string(),
127130
Integer::New(env->isolate(), fd),

src/stream_base.cc

+5-2
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,15 @@ namespace node {
1818
using v8::Array;
1919
using v8::ArrayBuffer;
2020
using v8::Context;
21+
using v8::DontDelete;
22+
using v8::DontEnum;
2123
using v8::External;
2224
using v8::FunctionCallbackInfo;
2325
using v8::HandleScope;
2426
using v8::Integer;
2527
using v8::Local;
2628
using v8::Object;
29+
using v8::ReadOnly;
2730
using v8::String;
2831
using v8::Value;
2932

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

350-
enum PropertyAttribute attributes = static_cast<PropertyAttribute>(
351-
v8::ReadOnly | v8::DontDelete | v8::DontEnum);
353+
enum PropertyAttribute attributes =
354+
static_cast<PropertyAttribute>(ReadOnly | DontDelete | DontEnum);
352355
Local<Signature> sig = Signature::New(env->isolate(), t);
353356

354357
AddMethod(env, sig, attributes, t, GetFD, env->fd_string());

src/udp_wrap.cc

+3-1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ namespace node {
3030

3131
using v8::Array;
3232
using v8::Context;
33+
using v8::DontDelete;
3334
using v8::FunctionCallbackInfo;
3435
using v8::FunctionTemplate;
3536
using v8::HandleScope;
@@ -38,6 +39,7 @@ using v8::Local;
3839
using v8::MaybeLocal;
3940
using v8::Object;
4041
using v8::PropertyAttribute;
42+
using v8::ReadOnly;
4143
using v8::Signature;
4244
using v8::String;
4345
using v8::Uint32;
@@ -98,7 +100,7 @@ void UDPWrap::Initialize(Local<Object> target,
98100
t->SetClassName(udpString);
99101

100102
enum PropertyAttribute attributes =
101-
static_cast<PropertyAttribute>(v8::ReadOnly | v8::DontDelete);
103+
static_cast<PropertyAttribute>(ReadOnly | DontDelete);
102104

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

0 commit comments

Comments
 (0)