Skip to content

Commit

Permalink
src: elevate v8 namespaces for node_process.cc
Browse files Browse the repository at this point in the history
Elevate namespace for repeated entities.
Resolved conflicts.

PR-URL: #24578
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Refael Ackermann <[email protected]>
Reviewed-By: Gireesh Punathil <[email protected]>
Reviewed-By: Daniel Bevenius <[email protected]>
Reviewed-By: James M Snell <[email protected]>
  • Loading branch information
Jayasankar-m authored and BethGriggs committed Jun 25, 2019
1 parent 5ffe047 commit 08a32fb
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/node_process.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -129,7 +130,7 @@ void Cwd(const FunctionCallbackInfo<Value>& args) {

Local<String> cwd = String::NewFromUtf8(env->isolate(),
buf,
v8::NewStringType::kNormal,
NewStringType::kNormal,
cwd_len).ToLocalChecked();
args.GetReturnValue().Set(cwd);
}
Expand Down Expand Up @@ -577,7 +578,7 @@ void ProcessTitleGetter(Local<Name> 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());
}


Expand All @@ -602,7 +603,7 @@ void EnvGetter(Local<Name> 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);
Expand All @@ -618,7 +619,7 @@ void EnvGetter(Local<Name> property,
result < arraysize(buffer)) {
const uint16_t* two_byte_buffer = reinterpret_cast<const uint16_t*>(buffer);
v8::MaybeLocal<String> 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;
Expand Down Expand Up @@ -734,7 +735,7 @@ void EnvEnumerator(const PropertyCallbackInfo<Array>& info) {
const int length = s ? s - var : strlen(var);
argv[idx] = String::NewFromUtf8(isolate,
var,
v8::NewStringType::kNormal,
NewStringType::kNormal,
length).ToLocalChecked();
if (++idx >= arraysize(argv)) {
fn->Call(ctx, envarr, idx, argv).ToLocalChecked();
Expand Down Expand Up @@ -767,7 +768,7 @@ void EnvEnumerator(const PropertyCallbackInfo<Array>& info) {
v8::MaybeLocal<String> 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));
Expand Down

0 comments on commit 08a32fb

Please sign in to comment.