Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

src: elevate v8 namespaces for node_process.cc #24578

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions src/node_process.cc
Original file line number Diff line number Diff line change
@@ -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<Value>& args) {

Local<String> 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<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());
}


@@ -616,7 +617,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);
@@ -632,7 +633,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;
@@ -744,7 +745,7 @@ void EnvEnumerator(const PropertyCallbackInfo<Array>& 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<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));