Skip to content

Commit

Permalink
src: fix Set() usage in env-inl.h
Browse files Browse the repository at this point in the history
PR-URL: #24060
Reviewed-By: Daniel Bevenius <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
  • Loading branch information
cjihrig committed Nov 7, 2018
1 parent ff0719d commit 7c64133
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/env-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
}

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

Expand Down

0 comments on commit 7c64133

Please sign in to comment.