Skip to content

Commit 1cda9b3

Browse files
cjihrigBridgeAR
authored andcommitted
src: fix Set() usage in env-inl.h
PR-URL: #24060 Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
1 parent bef1c3b commit 1cda9b3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/env-inl.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -740,7 +740,7 @@ inline void Environment::SetMethod(v8::Local<v8::Object> that,
740740
const v8::NewStringType type = v8::NewStringType::kInternalized;
741741
v8::Local<v8::String> name_string =
742742
v8::String::NewFromUtf8(isolate(), name, type).ToLocalChecked();
743-
that->Set(name_string, function);
743+
that->Set(context, name_string, function).FromJust();
744744
function->SetName(name_string); // NODE_SET_METHOD() compatibility.
745745
}
746746

@@ -760,7 +760,7 @@ inline void Environment::SetMethodNoSideEffect(v8::Local<v8::Object> that,
760760
const v8::NewStringType type = v8::NewStringType::kInternalized;
761761
v8::Local<v8::String> name_string =
762762
v8::String::NewFromUtf8(isolate(), name, type).ToLocalChecked();
763-
that->Set(name_string, function);
763+
that->Set(context, name_string, function).FromJust();
764764
function->SetName(name_string); // NODE_SET_METHOD() compatibility.
765765
}
766766

0 commit comments

Comments
 (0)