From bbb9d3721b0b26a821df38c888279646d1cbd329 Mon Sep 17 00:00:00 2001 From: Jayasankar Date: Fri, 23 Nov 2018 15:39:20 +0530 Subject: [PATCH] src: elevate v8 namespaces for node_process.cc Elevate namespace for repeated entities. Resolved conflicts. PR-URL: https://github.com/nodejs/node/pull/24578 Reviewed-By: Colin Ihrig Reviewed-By: Refael Ackermann Reviewed-By: Gireesh Punathil Reviewed-By: Daniel Bevenius Reviewed-By: James M Snell --- src/node_process.cc | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/node_process.cc b/src/node_process.cc index f52e985687c661..a3ccc2343e96e3 100644 --- a/src/node_process.cc +++ b/src/node_process.cc @@ -54,6 +54,7 @@ using v8::Integer; using v8::Isolate; using v8::Local; using v8::Name; +using v8::NewStringType; using v8::PropertyCallbackInfo; using v8::String; using v8::Uint32; @@ -135,7 +136,7 @@ void Cwd(const FunctionCallbackInfo& args) { Local cwd = String::NewFromUtf8(env->isolate(), buf, - v8::NewStringType::kNormal, + NewStringType::kNormal, cwd_len).ToLocalChecked(); args.GetReturnValue().Set(cwd); } @@ -591,7 +592,7 @@ void ProcessTitleGetter(Local property, char buffer[512]; uv_get_process_title(buffer, sizeof(buffer)); info.GetReturnValue().Set(String::NewFromUtf8(info.GetIsolate(), buffer, - v8::NewStringType::kNormal).ToLocalChecked()); + NewStringType::kNormal).ToLocalChecked()); } @@ -616,7 +617,7 @@ void EnvGetter(Local property, const char* val = getenv(*key); if (val) { return info.GetReturnValue().Set(String::NewFromUtf8(isolate, val, - v8::NewStringType::kNormal).ToLocalChecked()); + NewStringType::kNormal).ToLocalChecked()); } #else // _WIN32 node::TwoByteValue key(isolate, property); @@ -632,7 +633,7 @@ void EnvGetter(Local property, result < arraysize(buffer)) { const uint16_t* two_byte_buffer = reinterpret_cast(buffer); v8::MaybeLocal rc = String::NewFromTwoByte( - isolate, two_byte_buffer, v8::NewStringType::kNormal); + isolate, two_byte_buffer, NewStringType::kNormal); if (rc.IsEmpty()) { isolate->ThrowException(ERR_STRING_TOO_LONG(isolate)); return; @@ -744,7 +745,7 @@ void EnvEnumerator(const PropertyCallbackInfo& info) { const char* s = strchr(var, '='); const int length = s ? s - var : strlen(var); env_v[i] = - String::NewFromUtf8(isolate, var, v8::NewStringType::kNormal, length) + String::NewFromUtf8(isolate, var, NewStringType::kNormal, length) .ToLocalChecked(); } #else // _WIN32 @@ -770,7 +771,7 @@ void EnvEnumerator(const PropertyCallbackInfo& info) { v8::MaybeLocal rc = String::NewFromTwoByte(isolate, two_byte_buffer, - v8::NewStringType::kNormal, + NewStringType::kNormal, two_byte_buffer_len); if (rc.IsEmpty()) { isolate->ThrowException(ERR_STRING_TOO_LONG(isolate));