File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -1109,6 +1109,31 @@ napi_status NAPI_CDECL napi_set_property(napi_env env,
11091109 return GET_RETURN_STATUS (env);
11101110}
11111111
1112+ napi_status NAPI_CDECL napi_set_property_utf16 (napi_env env,
1113+ napi_value object,
1114+ const uint16_t * utf16name,
1115+ napi_value value) {
1116+ NAPI_PREAMBLE (env);
1117+ CHECK_ARG (env, utf16name);
1118+ CHECK_ARG (env, value);
1119+
1120+ v8::Local<v8::Context> context = env->context ();
1121+ v8::Local<v8::Object> obj;
1122+
1123+ CHECK_TO_OBJECT (env, context, obj, object);
1124+
1125+ v8::Local<v8::Value> k = v8::String::NewFromTwoByte (context->GetIsolate (),
1126+ utf16name,
1127+ v8::NewStringType::kNormal )
1128+ .ToLocalChecked ();
1129+ v8::Local<v8::Value> val = v8impl::V8LocalValueFromJsValue (value);
1130+
1131+ v8::Maybe<bool > set_maybe = obj->Set (context, k, val);
1132+
1133+ RETURN_STATUS_IF_FALSE (env, set_maybe.FromMaybe (false ), napi_generic_failure);
1134+ return GET_RETURN_STATUS (env);
1135+ }
1136+
11121137napi_status NAPI_CDECL napi_has_property (napi_env env,
11131138 napi_value object,
11141139 napi_value key,
You can’t perform that action at this time.
0 commit comments