mirror of https://github.com/nodejs/node.git
src: fix Set() usage in env-inl.h
PR-URL: https://github.com/nodejs/node/pull/24060 Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>pull/24060/head
parent
ff0719d5fb
commit
7c64133760
|
@ -736,7 +736,7 @@ inline void Environment::SetMethod(v8::Local<v8::Object> that,
|
|||
const v8::NewStringType type = v8::NewStringType::kInternalized;
|
||||
v8::Local<v8::String> name_string =
|
||||
v8::String::NewFromUtf8(isolate(), name, type).ToLocalChecked();
|
||||
that->Set(name_string, function);
|
||||
that->Set(context, name_string, function).FromJust();
|
||||
function->SetName(name_string); // NODE_SET_METHOD() compatibility.
|
||||
}
|
||||
|
||||
|
@ -756,7 +756,7 @@ inline void Environment::SetMethodNoSideEffect(v8::Local<v8::Object> that,
|
|||
const v8::NewStringType type = v8::NewStringType::kInternalized;
|
||||
v8::Local<v8::String> name_string =
|
||||
v8::String::NewFromUtf8(isolate(), name, type).ToLocalChecked();
|
||||
that->Set(name_string, function);
|
||||
that->Set(context, name_string, function).FromJust();
|
||||
function->SetName(name_string); // NODE_SET_METHOD() compatibility.
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue