Skip to content

Commit d624c19

Browse files
committed
src: switch from Get/SetPrototype to Get/SetPrototypeV2
1 parent 7ae193d commit d624c19

File tree

7 files changed

+18
-18
lines changed

7 files changed

+18
-18
lines changed

src/api/environment.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -769,7 +769,7 @@ Maybe<void> InitializePrimordials(Local<Context> context) {
769769

770770
// Create primordials first and make it available to per-context scripts.
771771
Local<Object> primordials = Object::New(isolate);
772-
if (primordials->SetPrototype(context, Null(isolate)).IsNothing() ||
772+
if (primordials->SetPrototypeV2(context, Null(isolate)).IsNothing() ||
773773
!GetPerContextExports(context).ToLocal(&exports) ||
774774
exports->Set(context, primordials_string, primordials).IsNothing()) {
775775
return Nothing<void>();

src/internal_only_v8.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ class PrototypeChainHas : public v8::QueryObjectPredicate {
3232
if (creation_context != context_) {
3333
return false;
3434
}
35-
for (Local<Value> proto = object->GetPrototype(); proto->IsObject();
36-
proto = proto.As<Object>()->GetPrototype()) {
35+
for (Local<Value> proto = object->GetPrototypeV2(); proto->IsObject();
36+
proto = proto.As<Object>()->GetPrototypeV2()) {
3737
if (search_ == proto) return true;
3838
}
3939
return false;

src/js_native_api_v8.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1577,7 +1577,7 @@ napi_status NAPI_CDECL napi_get_prototype(napi_env env,
15771577
CHECK_TO_OBJECT(env, context, obj, object);
15781578

15791579
// This doesn't invokes Proxy's [[GetPrototypeOf]] handler.
1580-
v8::Local<v8::Value> val = obj->GetPrototype();
1580+
v8::Local<v8::Value> val = obj->GetPrototypeV2();
15811581
*result = v8impl::JsValueFromV8LocalValue(val);
15821582
return GET_RETURN_STATUS(env);
15831583
}

src/node_buffer.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ MaybeLocal<Uint8Array> New(Environment* env,
279279
CHECK(!env->buffer_prototype_object().IsEmpty());
280280
Local<Uint8Array> ui = Uint8Array::New(ab, byte_offset, length);
281281
Maybe<bool> mb =
282-
ui->SetPrototype(env->context(), env->buffer_prototype_object());
282+
ui->SetPrototypeV2(env->context(), env->buffer_prototype_object());
283283
if (mb.IsNothing())
284284
return MaybeLocal<Uint8Array>();
285285
return ui;

src/node_constants.cc

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1285,42 +1285,42 @@ void CreatePerContextProperties(Local<Object> target,
12851285
Isolate* isolate = context->GetIsolate();
12861286
Environment* env = Environment::GetCurrent(context);
12871287

1288-
CHECK(target->SetPrototype(env->context(), Null(env->isolate())).FromJust());
1288+
CHECK(target->SetPrototypeV2(env->context(), Null(env->isolate())).FromJust());
12891289

12901290
Local<Object> os_constants = Object::New(isolate);
1291-
CHECK(os_constants->SetPrototype(env->context(),
1291+
CHECK(os_constants->SetPrototypeV2(env->context(),
12921292
Null(env->isolate())).FromJust());
12931293

12941294
Local<Object> err_constants = Object::New(isolate);
1295-
CHECK(err_constants->SetPrototype(env->context(),
1295+
CHECK(err_constants->SetPrototypeV2(env->context(),
12961296
Null(env->isolate())).FromJust());
12971297

12981298
Local<Object> sig_constants = Object::New(isolate);
1299-
CHECK(sig_constants->SetPrototype(env->context(),
1299+
CHECK(sig_constants->SetPrototypeV2(env->context(),
13001300
Null(env->isolate())).FromJust());
13011301

13021302
Local<Object> priority_constants = Object::New(isolate);
1303-
CHECK(priority_constants->SetPrototype(env->context(),
1303+
CHECK(priority_constants->SetPrototypeV2(env->context(),
13041304
Null(env->isolate())).FromJust());
13051305

13061306
Local<Object> fs_constants = Object::New(isolate);
1307-
CHECK(fs_constants->SetPrototype(env->context(),
1307+
CHECK(fs_constants->SetPrototypeV2(env->context(),
13081308
Null(env->isolate())).FromJust());
13091309

13101310
Local<Object> crypto_constants = Object::New(isolate);
1311-
CHECK(crypto_constants->SetPrototype(env->context(),
1311+
CHECK(crypto_constants->SetPrototypeV2(env->context(),
13121312
Null(env->isolate())).FromJust());
13131313

13141314
Local<Object> zlib_constants = Object::New(isolate);
1315-
CHECK(zlib_constants->SetPrototype(env->context(),
1315+
CHECK(zlib_constants->SetPrototypeV2(env->context(),
13161316
Null(env->isolate())).FromJust());
13171317

13181318
Local<Object> dlopen_constants = Object::New(isolate);
1319-
CHECK(dlopen_constants->SetPrototype(env->context(),
1319+
CHECK(dlopen_constants->SetPrototypeV2(env->context(),
13201320
Null(env->isolate())).FromJust());
13211321

13221322
Local<Object> trace_constants = Object::New(isolate);
1323-
CHECK(trace_constants->SetPrototype(env->context(),
1323+
CHECK(trace_constants->SetPrototypeV2(env->context(),
13241324
Null(env->isolate())).FromJust());
13251325

13261326
DefineErrnoConstants(err_constants);

src/node_options.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1391,7 +1391,7 @@ void GetCLIOptionsInfo(const FunctionCallbackInfo<Value>& args) {
13911391

13921392
Local<Map> options = Map::New(isolate);
13931393
if (options
1394-
->SetPrototype(context, env->primordials_safe_map_prototype_object())
1394+
->SetPrototypeV2(context, env->primordials_safe_map_prototype_object())
13951395
.IsNothing()) {
13961396
return;
13971397
}
@@ -1431,7 +1431,7 @@ void GetCLIOptionsInfo(const FunctionCallbackInfo<Value>& args) {
14311431
if (!ToV8Value(context, _ppop_instance.aliases_).ToLocal(&aliases)) return;
14321432

14331433
if (aliases.As<Object>()
1434-
->SetPrototype(context, env->primordials_safe_map_prototype_object())
1434+
->SetPrototypeV2(context, env->primordials_safe_map_prototype_object())
14351435
.IsNothing()) {
14361436
return;
14371437
}

src/node_webstorage.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,7 @@ template <typename T>
530530
static bool ShouldIntercept(Local<Name> property,
531531
const PropertyCallbackInfo<T>& info) {
532532
Environment* env = Environment::GetCurrent(info);
533-
Local<Value> proto = info.This()->GetPrototype();
533+
Local<Value> proto = info.This()->GetPrototypeV2();
534534

535535
if (proto->IsObject()) {
536536
bool has_prop;

0 commit comments

Comments
 (0)