Skip to content

Commit 5c81a10

Browse files
RaisinTenBethGriggs
authored andcommittedDec 15, 2020
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 75e49b8 commit 5c81a10

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
@@ -9,6 +9,8 @@ namespace node {
99
using v8::Array;
1010
using v8::Boolean;
1111
using v8::Context;
12+
using v8::DontDelete;
13+
using v8::DontEnum;
1214
using v8::EscapableHandleScope;
1315
using v8::HandleScope;
1416
using v8::Integer;
@@ -25,6 +27,7 @@ using v8::Object;
2527
using v8::ObjectTemplate;
2628
using v8::PropertyCallbackInfo;
2729
using v8::PropertyHandlerFlags;
30+
using v8::ReadOnly;
2831
using v8::String;
2932
using v8::Value;
3033

@@ -92,10 +95,10 @@ Maybe<std::string> RealEnvStore::Get(const char* key) const {
9295
}
9396

9497
if (ret >= 0) { // Env key value fetch success.
95-
return v8::Just(std::string(*val, init_sz));
98+
return Just(std::string(*val, init_sz));
9699
}
97100

98-
return v8::Nothing<std::string>();
101+
return Nothing<std::string>();
99102
}
100103

101104
MaybeLocal<String> RealEnvStore::Get(Isolate* isolate,
@@ -140,9 +143,9 @@ int32_t RealEnvStore::Query(const char* key) const {
140143

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

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

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

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

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

0 commit comments

Comments
 (0)
Please sign in to comment.