@@ -122,7 +122,6 @@ using v8::ObjectTemplate;
122122using v8::Promise;
123123using v8::PromiseRejectMessage;
124124using v8::PropertyCallbackInfo;
125- using v8::PropertyHandlerFlags;
126125using v8::ScriptOrigin;
127126using v8::SealHandleScope;
128127using v8::String;
@@ -2685,7 +2684,7 @@ static void EnvGetter(Local<Name> property,
26852684 return info.GetReturnValue ().Set (String::NewFromUtf8 (isolate, val));
26862685 }
26872686#else // _WIN32
2688- String::Value key (property);
2687+ node::TwoByteValue key (isolate, property);
26892688 WCHAR buffer[32767 ]; // The maximum size allowed for environment variables.
26902689 DWORD result = GetEnvironmentVariableW (reinterpret_cast <WCHAR*>(*key),
26912690 buffer,
@@ -2711,8 +2710,8 @@ static void EnvSetter(Local<Name> property,
27112710 node::Utf8Value val (info.GetIsolate (), value);
27122711 setenv (*key, *val, 1 );
27132712#else // _WIN32
2714- String::Value key (property);
2715- String::Value val (value);
2713+ node::TwoByteValue key (info. GetIsolate (), property);
2714+ node::TwoByteValue val (info. GetIsolate (), value);
27162715 WCHAR* key_ptr = reinterpret_cast <WCHAR*>(*key);
27172716 // Environment variables that start with '=' are read-only.
27182717 if (key_ptr[0 ] != L' =' ) {
@@ -2732,7 +2731,7 @@ static void EnvQuery(Local<Name> property,
27322731 if (getenv (*key))
27332732 rc = 0 ;
27342733#else // _WIN32
2735- String::Value key (property);
2734+ node::TwoByteValue key (info. GetIsolate (), property);
27362735 WCHAR* key_ptr = reinterpret_cast <WCHAR*>(*key);
27372736 if (GetEnvironmentVariableW (key_ptr, nullptr , 0 ) > 0 ||
27382737 GetLastError () == ERROR_SUCCESS) {
@@ -2756,7 +2755,7 @@ static void EnvDeleter(Local<Name> property,
27562755 node::Utf8Value key (info.GetIsolate (), property);
27572756 unsetenv (*key);
27582757#else
2759- String::Value key (property);
2758+ node::TwoByteValue key (info. GetIsolate (), property);
27602759 WCHAR* key_ptr = reinterpret_cast <WCHAR*>(*key);
27612760 SetEnvironmentVariableW (key_ptr, nullptr );
27622761#endif
@@ -3155,8 +3154,7 @@ void SetupProcessObject(Environment* env,
31553154 EnvQuery,
31563155 EnvDeleter,
31573156 EnvEnumerator,
3158- env->as_external (),
3159- PropertyHandlerFlags::kOnlyInterceptStrings ));
3157+ env->as_external ()));
31603158
31613159 Local<Object> process_env =
31623160 process_env_template->NewInstance (env->context ()).ToLocalChecked ();
0 commit comments