Skip to content

Commit b2d04ce

Browse files
isheludkotargos
authored andcommitted
src: stop using v8::PropertyCallbackInfo<T>::This() (2)
Refs: #60616
1 parent 31333ef commit b2d04ce

3 files changed

Lines changed: 11 additions & 11 deletions

File tree

src/module_wrap.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1002,7 +1002,7 @@ void ModuleWrap::HasAsyncGraph(Local<Name> property,
10021002
Isolate* isolate = args.GetIsolate();
10031003
Environment* env = Environment::GetCurrent(isolate);
10041004
ModuleWrap* obj;
1005-
ASSIGN_OR_RETURN_UNWRAP(&obj, args.This());
1005+
ASSIGN_OR_RETURN_UNWRAP(&obj, args.HolderV2());
10061006

10071007
Local<Module> module = obj->module_.Get(isolate);
10081008
if (module->GetStatus() < Module::kInstantiated) {
@@ -1218,7 +1218,7 @@ void ModuleWrap::SetImportMetaResolveInitializer(
12181218
static void ImportMetaResolveLazyGetter(
12191219
Local<v8::Name> name, const PropertyCallbackInfo<Value>& info) {
12201220
Isolate* isolate = info.GetIsolate();
1221-
Local<Value> receiver_val = info.This();
1221+
Local<Value> receiver_val = info.HolderV2();
12221222
if (!receiver_val->IsObject()) {
12231223
THROW_ERR_INVALID_INVOCATION(isolate);
12241224
return;
@@ -1259,7 +1259,7 @@ static void PathHelpersLazyGetter(Local<v8::Name> name,
12591259
// When this getter is invoked in a vm context, the `Realm::GetCurrent(info)`
12601260
// returns a nullptr and retrieve the creation context via `this` object and
12611261
// get the creation Realm.
1262-
Local<Value> receiver_val = info.This();
1262+
Local<Value> receiver_val = info.HolderV2();
12631263
if (!receiver_val->IsObject()) {
12641264
THROW_ERR_INVALID_INVOCATION(isolate);
12651265
return;

src/node_util.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ static void DefineLazyPropertiesGetter(
366366
// When this getter is invoked in a vm context, the `Realm::GetCurrent(info)`
367367
// returns a nullptr and retrieve the creation context via `this` object and
368368
// get the creation Realm.
369-
Local<Value> receiver_val = info.This();
369+
Local<Value> receiver_val = info.HolderV2();
370370
if (!receiver_val->IsObject()) {
371371
THROW_ERR_INVALID_INVOCATION(isolate);
372372
return;

src/node_webstorage.cc

Lines changed: 7 additions & 7 deletions
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()->GetPrototypeV2();
533+
Local<Value> proto = info.HolderV2()->GetPrototypeV2();
534534

535535
if (proto->IsObject()) {
536536
bool has_prop;
@@ -554,7 +554,7 @@ static Intercepted StorageGetter(Local<Name> property,
554554
}
555555

556556
Storage* storage;
557-
ASSIGN_OR_RETURN_UNWRAP(&storage, info.This(), Intercepted::kNo);
557+
ASSIGN_OR_RETURN_UNWRAP(&storage, info.HolderV2(), Intercepted::kNo);
558558
Local<Value> result;
559559

560560
if (storage->Load(property).ToLocal(&result) && !result->IsNull()) {
@@ -568,7 +568,7 @@ static Intercepted StorageSetter(Local<Name> property,
568568
Local<Value> value,
569569
const PropertyCallbackInfo<void>& info) {
570570
Storage* storage;
571-
ASSIGN_OR_RETURN_UNWRAP(&storage, info.This(), Intercepted::kNo);
571+
ASSIGN_OR_RETURN_UNWRAP(&storage, info.HolderV2(), Intercepted::kNo);
572572

573573
if (storage->Store(property, value).IsNothing()) {
574574
info.GetReturnValue().SetFalse();
@@ -584,7 +584,7 @@ static Intercepted StorageQuery(Local<Name> property,
584584
}
585585

586586
Storage* storage;
587-
ASSIGN_OR_RETURN_UNWRAP(&storage, info.This(), Intercepted::kNo);
587+
ASSIGN_OR_RETURN_UNWRAP(&storage, info.HolderV2(), Intercepted::kNo);
588588
Local<Value> result;
589589
if (!storage->Load(property).ToLocal(&result) || result->IsNull()) {
590590
return Intercepted::kNo;
@@ -597,7 +597,7 @@ static Intercepted StorageQuery(Local<Name> property,
597597
static Intercepted StorageDeleter(Local<Name> property,
598598
const PropertyCallbackInfo<Boolean>& info) {
599599
Storage* storage;
600-
ASSIGN_OR_RETURN_UNWRAP(&storage, info.This(), Intercepted::kNo);
600+
ASSIGN_OR_RETURN_UNWRAP(&storage, info.HolderV2(), Intercepted::kNo);
601601

602602
info.GetReturnValue().Set(storage->Remove(property).IsJust());
603603

@@ -606,7 +606,7 @@ static Intercepted StorageDeleter(Local<Name> property,
606606

607607
static void StorageEnumerator(const PropertyCallbackInfo<Array>& info) {
608608
Storage* storage;
609-
ASSIGN_OR_RETURN_UNWRAP(&storage, info.This());
609+
ASSIGN_OR_RETURN_UNWRAP(&storage, info.HolderV2());
610610
Local<Array> result;
611611
if (!storage->Enumerate().ToLocal(&result)) {
612612
return;
@@ -618,7 +618,7 @@ static Intercepted StorageDefiner(Local<Name> property,
618618
const PropertyDescriptor& desc,
619619
const PropertyCallbackInfo<void>& info) {
620620
Storage* storage;
621-
ASSIGN_OR_RETURN_UNWRAP(&storage, info.This(), Intercepted::kNo);
621+
ASSIGN_OR_RETURN_UNWRAP(&storage, info.HolderV2(), Intercepted::kNo);
622622

623623
if (desc.has_value()) {
624624
return StorageSetter(property, desc.value(), info);

0 commit comments

Comments
 (0)