Skip to content

Commit

Permalink
fixup! src: switch from Get/SetPrototype to Get/SetPrototypeV2
Browse files Browse the repository at this point in the history
  • Loading branch information
avivkeller committed Oct 18, 2024
1 parent d624c19 commit 5d3c0bb
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 21 deletions.
39 changes: 20 additions & 19 deletions src/node_constants.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1285,43 +1285,44 @@ void CreatePerContextProperties(Local<Object> target,
Isolate* isolate = context->GetIsolate();
Environment* env = Environment::GetCurrent(context);

CHECK(target->SetPrototypeV2(env->context(), Null(env->isolate())).FromJust());
CHECK(
target->SetPrototypeV2(env->context(), Null(env->isolate())).FromJust());

Local<Object> os_constants = Object::New(isolate);
CHECK(os_constants->SetPrototypeV2(env->context(),
Null(env->isolate())).FromJust());
CHECK(os_constants->SetPrototypeV2(env->context(), Null(env->isolate()))
.FromJust());

Local<Object> err_constants = Object::New(isolate);
CHECK(err_constants->SetPrototypeV2(env->context(),
Null(env->isolate())).FromJust());
CHECK(err_constants->SetPrototypeV2(env->context(), Null(env->isolate()))
.FromJust());

Local<Object> sig_constants = Object::New(isolate);
CHECK(sig_constants->SetPrototypeV2(env->context(),
Null(env->isolate())).FromJust());
CHECK(sig_constants->SetPrototypeV2(env->context(), Null(env->isolate()))
.FromJust());

Local<Object> priority_constants = Object::New(isolate);
CHECK(priority_constants->SetPrototypeV2(env->context(),
Null(env->isolate())).FromJust());
CHECK(priority_constants->SetPrototypeV2(env->context(), Null(env->isolate()))
.FromJust());

Local<Object> fs_constants = Object::New(isolate);
CHECK(fs_constants->SetPrototypeV2(env->context(),
Null(env->isolate())).FromJust());
CHECK(fs_constants->SetPrototypeV2(env->context(), Null(env->isolate()))
.FromJust());

Local<Object> crypto_constants = Object::New(isolate);
CHECK(crypto_constants->SetPrototypeV2(env->context(),
Null(env->isolate())).FromJust());
CHECK(crypto_constants->SetPrototypeV2(env->context(), Null(env->isolate()))
.FromJust());

Local<Object> zlib_constants = Object::New(isolate);
CHECK(zlib_constants->SetPrototypeV2(env->context(),
Null(env->isolate())).FromJust());
CHECK(zlib_constants->SetPrototypeV2(env->context(), Null(env->isolate()))
.FromJust());

Local<Object> dlopen_constants = Object::New(isolate);
CHECK(dlopen_constants->SetPrototypeV2(env->context(),
Null(env->isolate())).FromJust());
CHECK(dlopen_constants->SetPrototypeV2(env->context(), Null(env->isolate()))
.FromJust());

Local<Object> trace_constants = Object::New(isolate);
CHECK(trace_constants->SetPrototypeV2(env->context(),
Null(env->isolate())).FromJust());
CHECK(trace_constants->SetPrototypeV2(env->context(), Null(env->isolate()))
.FromJust());

DefineErrnoConstants(err_constants);
DefineWindowsErrorConstants(err_constants);
Expand Down
6 changes: 4 additions & 2 deletions src/node_options.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1391,7 +1391,8 @@ void GetCLIOptionsInfo(const FunctionCallbackInfo<Value>& args) {

Local<Map> options = Map::New(isolate);
if (options
->SetPrototypeV2(context, env->primordials_safe_map_prototype_object())
->SetPrototypeV2(context,
env->primordials_safe_map_prototype_object())
.IsNothing()) {
return;
}
Expand Down Expand Up @@ -1431,7 +1432,8 @@ void GetCLIOptionsInfo(const FunctionCallbackInfo<Value>& args) {
if (!ToV8Value(context, _ppop_instance.aliases_).ToLocal(&aliases)) return;

if (aliases.As<Object>()
->SetPrototypeV2(context, env->primordials_safe_map_prototype_object())
->SetPrototypeV2(context,
env->primordials_safe_map_prototype_object())
.IsNothing()) {
return;
}
Expand Down

0 comments on commit 5d3c0bb

Please sign in to comment.