@@ -52,7 +52,9 @@ using v8::HeapStatistics;
5252using v8::Integer;
5353using v8::Isolate;
5454using v8::Local;
55+ using v8::MaybeLocal;
5556using v8::Name;
57+ using v8::NewStringType;
5658using v8::Number;
5759using v8::PropertyCallbackInfo;
5860using v8::String;
@@ -626,7 +628,8 @@ void EnvGetter(Local<Name> property,
626628 if ((result > 0 || GetLastError () == ERROR_SUCCESS) &&
627629 result < arraysize (buffer)) {
628630 const uint16_t * two_byte_buffer = reinterpret_cast <const uint16_t *>(buffer);
629- Local<String> rc = String::NewFromTwoByte (isolate, two_byte_buffer);
631+ MaybeLocal<String> rc = String::NewFromTwoByte (
632+ isolate, two_byte_buffer, NewStringType::kNormal );
630633 return info.GetReturnValue ().Set (rc);
631634 }
632635#endif
@@ -768,10 +771,8 @@ void EnvEnumerator(const PropertyCallbackInfo<Array>& info) {
768771 }
769772 const uint16_t * two_byte_buffer = reinterpret_cast <const uint16_t *>(p);
770773 const size_t two_byte_buffer_len = s - p;
771- argv[idx] = String::NewFromTwoByte (isolate,
772- two_byte_buffer,
773- String::kNormalString ,
774- two_byte_buffer_len);
774+ argv[idx] = String::NewFromTwoByte (
775+ isolate, two_byte_buffer, NewStringType::kNormal , two_byte_buffer_len);
775776 if (++idx >= arraysize (argv)) {
776777 fn->Call (ctx, envarr, idx, argv).ToLocalChecked ();
777778 idx = 0 ;
0 commit comments