From 878c592771b68fc9c7925eac589e39ce1a48fef0 Mon Sep 17 00:00:00 2001 From: Igor Sheludko Date: Mon, 8 Dec 2025 11:05:28 +0100 Subject: [PATCH] Stop using deprecated v8::PropertyCallbackInfo::This(), pt.2 See https://github.com/nodejs/node/issues/60616 --- src/module_wrap.cc | 6 +++--- src/node_util.cc | 2 +- src/node_webstorage.cc | 14 +++++++------- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/module_wrap.cc b/src/module_wrap.cc index 2dc4b2c37f37ba..710bd06333b79e 100644 --- a/src/module_wrap.cc +++ b/src/module_wrap.cc @@ -1005,7 +1005,7 @@ void ModuleWrap::HasAsyncGraph(Local property, Isolate* isolate = args.GetIsolate(); Environment* env = Environment::GetCurrent(isolate); ModuleWrap* obj; - ASSIGN_OR_RETURN_UNWRAP(&obj, args.This()); + ASSIGN_OR_RETURN_UNWRAP(&obj, args.HolderV2()); Local module = obj->module_.Get(isolate); if (module->GetStatus() < Module::kInstantiated) { @@ -1221,7 +1221,7 @@ void ModuleWrap::SetImportMetaResolveInitializer( static void ImportMetaResolveLazyGetter( Local name, const PropertyCallbackInfo& info) { Isolate* isolate = info.GetIsolate(); - Local receiver_val = info.This(); + Local receiver_val = info.HolderV2(); if (!receiver_val->IsObject()) { THROW_ERR_INVALID_INVOCATION(isolate); return; @@ -1262,7 +1262,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.This(); + Local receiver_val = info.HolderV2(); if (!receiver_val->IsObject()) { THROW_ERR_INVALID_INVOCATION(isolate); return; diff --git a/src/node_util.cc b/src/node_util.cc index 2e4d98a8a66a18..0306e0b5d85269 100644 --- a/src/node_util.cc +++ b/src/node_util.cc @@ -370,7 +370,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.This(); + Local receiver_val = info.HolderV2(); if (!receiver_val->IsObject()) { THROW_ERR_INVALID_INVOCATION(isolate); return; diff --git a/src/node_webstorage.cc b/src/node_webstorage.cc index 5819d9bca845e0..f4139f25f22b07 100644 --- a/src/node_webstorage.cc +++ b/src/node_webstorage.cc @@ -531,7 +531,7 @@ template static bool ShouldIntercept(Local property, const PropertyCallbackInfo& info) { Environment* env = Environment::GetCurrent(info); - Local proto = info.This()->GetPrototypeV2(); + Local proto = info.HolderV2()->GetPrototypeV2(); if (proto->IsObject()) { bool has_prop; @@ -555,7 +555,7 @@ static Intercepted StorageGetter(Local property, } Storage* storage; - ASSIGN_OR_RETURN_UNWRAP(&storage, info.This(), Intercepted::kNo); + ASSIGN_OR_RETURN_UNWRAP(&storage, info.HolderV2(), Intercepted::kNo); Local result; if (storage->Load(property).ToLocal(&result) && !result->IsNull()) { @@ -569,7 +569,7 @@ static Intercepted StorageSetter(Local property, Local value, const PropertyCallbackInfo& info) { Storage* storage; - ASSIGN_OR_RETURN_UNWRAP(&storage, info.This(), Intercepted::kNo); + ASSIGN_OR_RETURN_UNWRAP(&storage, info.HolderV2(), Intercepted::kNo); if (storage->Store(property, value).IsNothing()) { info.GetReturnValue().SetFalse(); @@ -585,7 +585,7 @@ static Intercepted StorageQuery(Local property, } Storage* storage; - ASSIGN_OR_RETURN_UNWRAP(&storage, info.This(), Intercepted::kNo); + ASSIGN_OR_RETURN_UNWRAP(&storage, info.HolderV2(), Intercepted::kNo); Local result; if (!storage->Load(property).ToLocal(&result) || result->IsNull()) { return Intercepted::kNo; @@ -598,7 +598,7 @@ static Intercepted StorageQuery(Local property, static Intercepted StorageDeleter(Local property, const PropertyCallbackInfo& info) { Storage* storage; - ASSIGN_OR_RETURN_UNWRAP(&storage, info.This(), Intercepted::kNo); + ASSIGN_OR_RETURN_UNWRAP(&storage, info.HolderV2(), Intercepted::kNo); info.GetReturnValue().Set(storage->Remove(property).IsJust()); @@ -607,7 +607,7 @@ static Intercepted StorageDeleter(Local property, static void StorageEnumerator(const PropertyCallbackInfo& info) { Storage* storage; - ASSIGN_OR_RETURN_UNWRAP(&storage, info.This()); + ASSIGN_OR_RETURN_UNWRAP(&storage, info.HolderV2()); Local result; if (!storage->Enumerate().ToLocal(&result)) { return; @@ -619,7 +619,7 @@ static Intercepted StorageDefiner(Local property, const PropertyDescriptor& desc, const PropertyCallbackInfo& info) { Storage* storage; - ASSIGN_OR_RETURN_UNWRAP(&storage, info.This(), Intercepted::kNo); + ASSIGN_OR_RETURN_UNWRAP(&storage, info.HolderV2(), Intercepted::kNo); if (desc.has_value()) { return StorageSetter(property, desc.value(), info);