Skip to content

Commit 7086f2e

Browse files
RaisinTencodebytere
authored andcommitted
src: refactor using-declarations node_env_var.cc
PR-URL: #36128 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rich Trott <rtrott@gmail.com>
1 parent 73bb54a commit 7086f2e

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

src/node_env_var.cc

+10-7
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ namespace node {
1010
using v8::Array;
1111
using v8::Boolean;
1212
using v8::Context;
13+
using v8::DontDelete;
14+
using v8::DontEnum;
1315
using v8::EscapableHandleScope;
1416
using v8::HandleScope;
1517
using v8::Integer;
@@ -26,6 +28,7 @@ using v8::Object;
2628
using v8::ObjectTemplate;
2729
using v8::PropertyCallbackInfo;
2830
using v8::PropertyHandlerFlags;
31+
using v8::ReadOnly;
2932
using v8::String;
3033
using v8::Value;
3134

@@ -93,10 +96,10 @@ Maybe<std::string> RealEnvStore::Get(const char* key) const {
9396
}
9497

9598
if (ret >= 0) { // Env key value fetch success.
96-
return v8::Just(std::string(*val, init_sz));
99+
return Just(std::string(*val, init_sz));
97100
}
98101

99-
return v8::Nothing<std::string>();
102+
return Nothing<std::string>();
100103
}
101104

102105
MaybeLocal<String> RealEnvStore::Get(Isolate* isolate,
@@ -141,9 +144,9 @@ int32_t RealEnvStore::Query(const char* key) const {
141144

142145
#ifdef _WIN32
143146
if (key[0] == '=') {
144-
return static_cast<int32_t>(v8::ReadOnly) |
145-
static_cast<int32_t>(v8::DontDelete) |
146-
static_cast<int32_t>(v8::DontEnum);
147+
return static_cast<int32_t>(ReadOnly) |
148+
static_cast<int32_t>(DontDelete) |
149+
static_cast<int32_t>(DontEnum);
147150
}
148151
#endif
149152

@@ -191,7 +194,7 @@ Local<Array> RealEnvStore::Enumerate(Isolate* isolate) const {
191194
return Array::New(isolate, env_v.out(), env_v_index);
192195
}
193196

194-
std::shared_ptr<KVStore> KVStore::Clone(v8::Isolate* isolate) const {
197+
std::shared_ptr<KVStore> KVStore::Clone(Isolate* isolate) const {
195198
HandleScope handle_scope(isolate);
196199
Local<Context> context = isolate->GetCurrentContext();
197200

@@ -211,7 +214,7 @@ std::shared_ptr<KVStore> KVStore::Clone(v8::Isolate* isolate) const {
211214
Maybe<std::string> MapKVStore::Get(const char* key) const {
212215
Mutex::ScopedLock lock(mutex_);
213216
auto it = map_.find(key);
214-
return it == map_.end() ? v8::Nothing<std::string>() : v8::Just(it->second);
217+
return it == map_.end() ? Nothing<std::string>() : Just(it->second);
215218
}
216219

217220
MaybeLocal<String> MapKVStore::Get(Isolate* isolate, Local<String> key) const {

0 commit comments

Comments
 (0)