diff --git a/src/node_process.cc b/src/node_process.cc index 51041c49eda71b..93089f883e6753 100644 --- a/src/node_process.cc +++ b/src/node_process.cc @@ -52,7 +52,9 @@ using v8::HeapStatistics; using v8::Integer; using v8::Isolate; using v8::Local; +using v8::MaybeLocal; using v8::Name; +using v8::NewStringType; using v8::Number; using v8::PropertyCallbackInfo; using v8::String; @@ -626,7 +628,8 @@ void EnvGetter(Local property, if ((result > 0 || GetLastError() == ERROR_SUCCESS) && result < arraysize(buffer)) { const uint16_t* two_byte_buffer = reinterpret_cast(buffer); - Local rc = String::NewFromTwoByte(isolate, two_byte_buffer); + MaybeLocal rc = String::NewFromTwoByte( + isolate, two_byte_buffer, NewStringType::kNormal); return info.GetReturnValue().Set(rc); } #endif @@ -768,10 +771,8 @@ void EnvEnumerator(const PropertyCallbackInfo& info) { } const uint16_t* two_byte_buffer = reinterpret_cast(p); const size_t two_byte_buffer_len = s - p; - argv[idx] = String::NewFromTwoByte(isolate, - two_byte_buffer, - String::kNormalString, - two_byte_buffer_len); + argv[idx] = String::NewFromTwoByte( + isolate, two_byte_buffer, NewStringType::kNormal, two_byte_buffer_len); if (++idx >= arraysize(argv)) { fn->Call(ctx, envarr, idx, argv).ToLocalChecked(); idx = 0;