diff --git a/src/api/environment.cc b/src/api/environment.cc index 9ebc20223fe97e..4d991a35584a9f 100644 --- a/src/api/environment.cc +++ b/src/api/environment.cc @@ -958,7 +958,7 @@ MaybeLocal InitializePrivateSymbols(Local context, Local private_symbols_object; if (!private_symbols->NewInstance(context).ToLocal(&private_symbols_object) || - private_symbols_object->SetPrototypeV2(context, Null(isolate)) + private_symbols_object->SetPrototype(context, Null(isolate)) .IsNothing()) { return MaybeLocal(); } @@ -984,7 +984,7 @@ MaybeLocal InitializePerIsolateSymbols(Local context, Local per_isolate_symbols_object; if (!per_isolate_symbols->NewInstance(context).ToLocal( &per_isolate_symbols_object) || - per_isolate_symbols_object->SetPrototypeV2(context, Null(isolate)) + per_isolate_symbols_object->SetPrototype(context, Null(isolate)) .IsNothing()) { return MaybeLocal(); } diff --git a/src/internal_only_v8.cc b/src/internal_only_v8.cc index 6a3c4e6952a8f3..487b8b7adfd356 100644 --- a/src/internal_only_v8.cc +++ b/src/internal_only_v8.cc @@ -33,8 +33,8 @@ class PrototypeChainHas : public v8::QueryObjectPredicate { if (creation_context != context_) { return false; } - for (Local proto = object->GetPrototypeV2(); proto->IsObject(); - proto = proto.As()->GetPrototypeV2()) { + for (Local proto = object->GetPrototype(); proto->IsObject(); + proto = proto.As()->GetPrototype()) { if (search_ == proto) return true; } return false; diff --git a/src/js_native_api_v8.cc b/src/js_native_api_v8.cc index d9e3cc66f8de2c..ef1d2743552b12 100644 --- a/src/js_native_api_v8.cc +++ b/src/js_native_api_v8.cc @@ -1585,7 +1585,7 @@ napi_status NAPI_CDECL node_api_set_prototype(napi_env env, v8::Local val = v8impl::V8LocalValueFromJsValue(value); - v8::Maybe set_maybe = obj->SetPrototypeV2(context, val); + v8::Maybe set_maybe = obj->SetPrototype(context, val); RETURN_STATUS_IF_FALSE_WITH_PREAMBLE( env, set_maybe.FromMaybe(false), napi_generic_failure); @@ -1604,7 +1604,7 @@ napi_status NAPI_CDECL napi_get_prototype(napi_env env, CHECK_TO_OBJECT(env, context, obj, object); // This doesn't invokes Proxy's [[GetPrototypeOf]] handler. - v8::Local val = obj->GetPrototypeV2(); + v8::Local val = obj->GetPrototype(); *result = v8impl::JsValueFromV8LocalValue(val); return GET_RETURN_STATUS(env); } diff --git a/src/module_wrap.cc b/src/module_wrap.cc index 70743ff6cd18ce..c6a0b0e703b949 100644 --- a/src/module_wrap.cc +++ b/src/module_wrap.cc @@ -1035,7 +1035,7 @@ void ModuleWrap::HasAsyncGraph(Local property, Isolate* isolate = args.GetIsolate(); Environment* env = Environment::GetCurrent(isolate); ModuleWrap* obj; - ASSIGN_OR_RETURN_UNWRAP(&obj, args.HolderV2()); + ASSIGN_OR_RETURN_UNWRAP(&obj, args.Holder()); Local module = obj->module_.Get(isolate); if (module->GetStatus() < Module::kInstantiated) { @@ -1251,7 +1251,7 @@ void ModuleWrap::SetImportMetaResolveInitializer( static void ImportMetaResolveLazyGetter( Local name, const PropertyCallbackInfo& info) { Isolate* isolate = info.GetIsolate(); - Local receiver_val = info.HolderV2(); + Local receiver_val = info.Holder(); if (!receiver_val->IsObject()) { THROW_ERR_INVALID_INVOCATION(isolate); return; @@ -1292,7 +1292,7 @@ static void PathHelpersLazyGetter(Local name, // When this getter is invoked in a vm context, the `Realm::GetCurrent(info)` // returns a nullptr and retrieve the creation context via `this` object and // get the creation Realm. - Local receiver_val = info.HolderV2(); + Local receiver_val = info.Holder(); if (!receiver_val->IsObject()) { THROW_ERR_INVALID_INVOCATION(isolate); return; diff --git a/src/node_buffer.cc b/src/node_buffer.cc index ba310268d80663..fd6bc52628994c 100644 --- a/src/node_buffer.cc +++ b/src/node_buffer.cc @@ -287,7 +287,7 @@ MaybeLocal New(Environment* env, size_t length) { CHECK(!env->buffer_prototype_object().IsEmpty()); Local ui = Uint8Array::New(ab, byte_offset, length); - if (ui->SetPrototypeV2(env->context(), env->buffer_prototype_object()) + if (ui->SetPrototype(env->context(), env->buffer_prototype_object()) .IsNothing()) { return MaybeLocal(); } diff --git a/src/node_constants.cc b/src/node_constants.cc index 50ece35429e932..07eb5e671cb3ea 100644 --- a/src/node_constants.cc +++ b/src/node_constants.cc @@ -1284,7 +1284,7 @@ void CreatePerContextProperties(Local target, Isolate* isolate = Isolate::GetCurrent(); Environment* env = Environment::GetCurrent(context); - CHECK(target->SetPrototypeV2(env->context(), Null(isolate)).FromJust()); + CHECK(target->SetPrototype(env->context(), Null(isolate)).FromJust()); Local os_constants = Object::New(isolate, Null(isolate), nullptr, nullptr, 0); diff --git a/src/node_contextify.cc b/src/node_contextify.cc index 066aa137676843..733c5845af98f1 100644 --- a/src/node_contextify.cc +++ b/src/node_contextify.cc @@ -454,7 +454,7 @@ ContextifyContext* ContextifyContext::Get(const PropertyCallbackInfo& args) { // args.GetIsolate()->GetCurrentContext() and take the pointer at // ContextEmbedderIndex::kContextifyContext, as V8 is supposed to // push the creation context before invoking these callbacks. - return Get(args.HolderV2()); + return Get(args.Holder()); } ContextifyContext* ContextifyContext::Get(Local object) { diff --git a/src/node_ffi.cc b/src/node_ffi.cc index d0c578cfedd46a..67659e012fbdda 100644 --- a/src/node_ffi.cc +++ b/src/node_ffi.cc @@ -489,7 +489,7 @@ void DynamicLibrary::GetFunctions(const FunctionCallbackInfo& args) { } Local functions = Object::New(isolate); - if (!functions->SetPrototypeV2(context, Null(isolate)).FromMaybe(false)) { + if (!functions->SetPrototype(context, Null(isolate)).FromMaybe(false)) { return; } @@ -645,7 +645,7 @@ void DynamicLibrary::GetSymbols(const FunctionCallbackInfo& args) { } Local symbols = Object::New(isolate); - if (!symbols->SetPrototypeV2(context, Null(isolate)).FromMaybe(false)) { + if (!symbols->SetPrototype(context, Null(isolate)).FromMaybe(false)) { return; } for (const auto& entry : lib->symbols_) { diff --git a/src/node_options.cc b/src/node_options.cc index a152d873052ff4..6dd7cdadbc149e 100644 --- a/src/node_options.cc +++ b/src/node_options.cc @@ -1830,8 +1830,7 @@ void GetCLIOptionsInfo(const FunctionCallbackInfo& args) { Local options = Map::New(isolate); if (options - ->SetPrototypeV2(context, - env->primordials_safe_map_prototype_object()) + ->SetPrototype(context, env->primordials_safe_map_prototype_object()) .IsNothing()) { return; } @@ -1871,8 +1870,7 @@ void GetCLIOptionsInfo(const FunctionCallbackInfo& args) { if (!ToV8Value(context, _ppop_instance.aliases_).ToLocal(&aliases)) return; if (aliases.As() - ->SetPrototypeV2(context, - env->primordials_safe_map_prototype_object()) + ->SetPrototype(context, env->primordials_safe_map_prototype_object()) .IsNothing()) { return; } diff --git a/src/node_sqlite.cc b/src/node_sqlite.cc index 31803e1b06bf85..78f7f7f5f3b4a2 100644 --- a/src/node_sqlite.cc +++ b/src/node_sqlite.cc @@ -748,7 +748,7 @@ Intercepted DatabaseSyncLimits::LimitsGetter( } DatabaseSyncLimits* limits; - ASSIGN_OR_RETURN_UNWRAP(&limits, info.HolderV2(), Intercepted::kNo); + ASSIGN_OR_RETURN_UNWRAP(&limits, info.Holder(), Intercepted::kNo); Environment* env = limits->env(); Isolate* isolate = env->isolate(); @@ -780,7 +780,7 @@ Intercepted DatabaseSyncLimits::LimitsSetter( } DatabaseSyncLimits* limits; - ASSIGN_OR_RETURN_UNWRAP(&limits, info.HolderV2(), Intercepted::kNo); + ASSIGN_OR_RETURN_UNWRAP(&limits, info.Holder(), Intercepted::kNo); Environment* env = limits->env(); Isolate* isolate = env->isolate(); @@ -2945,9 +2945,9 @@ BaseObjectPtr StatementExecutionHelper::Iterate( } if (iter->object() - ->GetPrototypeV2() + ->GetPrototype() .As() - ->SetPrototypeV2(context, js_iterator_prototype) + ->SetPrototype(context, js_iterator_prototype) .IsNothing()) { return BaseObjectPtr(); } diff --git a/src/node_util.cc b/src/node_util.cc index 8be8a8b5726a26..bf8391694f662d 100644 --- a/src/node_util.cc +++ b/src/node_util.cc @@ -366,7 +366,7 @@ static void DefineLazyPropertiesGetter( // When this getter is invoked in a vm context, the `Realm::GetCurrent(info)` // returns a nullptr and retrieve the creation context via `this` object and // get the creation Realm. - Local receiver_val = info.HolderV2(); + Local receiver_val = info.Holder(); if (!receiver_val->IsObject()) { THROW_ERR_INVALID_INVOCATION(isolate); return; diff --git a/src/node_webstorage.cc b/src/node_webstorage.cc index de899e25fe056c..bb1ec9338114cf 100644 --- a/src/node_webstorage.cc +++ b/src/node_webstorage.cc @@ -562,7 +562,7 @@ template static bool ShouldIntercept(Local property, const PropertyCallbackInfo& info) { Environment* env = Environment::GetCurrent(info); - Local proto = info.HolderV2()->GetPrototypeV2(); + Local proto = info.Holder()->GetPrototype(); if (proto->IsObject()) { bool has_prop; @@ -586,7 +586,7 @@ static Intercepted StorageGetter(Local property, } Storage* storage; - ASSIGN_OR_RETURN_UNWRAP(&storage, info.HolderV2(), Intercepted::kNo); + ASSIGN_OR_RETURN_UNWRAP(&storage, info.Holder(), Intercepted::kNo); Local result; if (storage->Load(property).ToLocal(&result) && !result->IsNull()) { @@ -600,7 +600,7 @@ static Intercepted StorageSetter(Local property, Local value, const PropertyCallbackInfo& info) { Storage* storage; - ASSIGN_OR_RETURN_UNWRAP(&storage, info.HolderV2(), Intercepted::kNo); + ASSIGN_OR_RETURN_UNWRAP(&storage, info.Holder(), Intercepted::kNo); if (storage->Store(property, value).IsNothing()) { info.GetReturnValue().SetFalse(); @@ -616,7 +616,7 @@ static Intercepted StorageQuery(Local property, } Storage* storage; - ASSIGN_OR_RETURN_UNWRAP(&storage, info.HolderV2(), Intercepted::kNo); + ASSIGN_OR_RETURN_UNWRAP(&storage, info.Holder(), Intercepted::kNo); Local result; if (!storage->Load(property).ToLocal(&result) || result->IsNull()) { return Intercepted::kNo; @@ -629,7 +629,7 @@ static Intercepted StorageQuery(Local property, static Intercepted StorageDeleter(Local property, const PropertyCallbackInfo& info) { Storage* storage; - ASSIGN_OR_RETURN_UNWRAP(&storage, info.HolderV2(), Intercepted::kNo); + ASSIGN_OR_RETURN_UNWRAP(&storage, info.Holder(), Intercepted::kNo); info.GetReturnValue().Set(storage->Remove(property).IsJust()); @@ -638,7 +638,7 @@ static Intercepted StorageDeleter(Local property, static void StorageEnumerator(const PropertyCallbackInfo& info) { Storage* storage; - ASSIGN_OR_RETURN_UNWRAP(&storage, info.HolderV2()); + ASSIGN_OR_RETURN_UNWRAP(&storage, info.Holder()); Local result; if (!storage->Enumerate().ToLocal(&result)) { return; @@ -650,7 +650,7 @@ static Intercepted StorageDefiner(Local property, const PropertyDescriptor& desc, const PropertyCallbackInfo& info) { Storage* storage; - ASSIGN_OR_RETURN_UNWRAP(&storage, info.HolderV2(), Intercepted::kNo); + ASSIGN_OR_RETURN_UNWRAP(&storage, info.Holder(), Intercepted::kNo); if (desc.has_value()) { return StorageSetter(property, desc.value(), info); diff --git a/src/util-inl.h b/src/util-inl.h index d59e30a635b08b..17f72857aa5ba4 100644 --- a/src/util-inl.h +++ b/src/util-inl.h @@ -811,7 +811,7 @@ inline v8::MaybeLocal NewDictionaryInstanceNullProto( if (value.IsEmpty()) return v8::MaybeLocal(); } v8::Local obj = tmpl->NewInstance(context, property_values); - if (obj->SetPrototypeV2(context, v8::Null(v8::Isolate::GetCurrent())) + if (obj->SetPrototype(context, v8::Null(v8::Isolate::GetCurrent())) .IsNothing()) { return v8::MaybeLocal(); }