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
cjihrig 2018-11-03 11:52:37 -04:00
parent ff0719d5fb
commit 7c64133760
No known key found for this signature in database
GPG Key ID: 7434390BDBE9B9C5
1 changed files with 2 additions and 2 deletions

View File

@ -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.
}