diff --git a/src/env-inl.h b/src/env-inl.h index da8ca222b3361f..30fed57b71fbed 100644 --- a/src/env-inl.h +++ b/src/env-inl.h @@ -740,7 +740,7 @@ inline void Environment::SetMethod(v8::Local that, const v8::NewStringType type = v8::NewStringType::kInternalized; v8::Local 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. } @@ -760,7 +760,7 @@ inline void Environment::SetMethodNoSideEffect(v8::Local that, const v8::NewStringType type = v8::NewStringType::kInternalized; v8::Local 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. }