Skip to content

Commit 878c592

Browse files
committed
Stop using deprecated v8::PropertyCallbackInfo<T>::This(), pt.2
See nodejs#60616
1 parent 55c3e94 commit 878c592

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

src/module_wrap.cc

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

10101010
Local<Module> module = obj->module_.Get(isolate);
10111011
if (module->GetStatus() < Module::kInstantiated) {
@@ -1221,7 +1221,7 @@ void ModuleWrap::SetImportMetaResolveInitializer(
12211221
static void ImportMetaResolveLazyGetter(
12221222
Local<v8::Name> name, const PropertyCallbackInfo<Value>& info) {
12231223
Isolate* isolate = info.GetIsolate();
1224-
Local<Value> receiver_val = info.This();
1224+
Local<Value> receiver_val = info.HolderV2();
12251225
if (!receiver_val->IsObject()) {
12261226
THROW_ERR_INVALID_INVOCATION(isolate);
12271227
return;
@@ -1262,7 +1262,7 @@ static void PathHelpersLazyGetter(Local<v8::Name> name,
12621262
// When this getter is invoked in a vm context, the `Realm::GetCurrent(info)`
12631263
// returns a nullptr and retrieve the creation context via `this` object and
12641264
// get the creation Realm.
1265-
Local<Value> receiver_val = info.This();
1265+
Local<Value> receiver_val = info.HolderV2();
12661266
if (!receiver_val->IsObject()) {
12671267
THROW_ERR_INVALID_INVOCATION(isolate);
12681268
return;

src/node_util.cc

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

src/node_webstorage.cc

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,7 @@ template <typename T>
531531
static bool ShouldIntercept(Local<Name> property,
532532
const PropertyCallbackInfo<T>& info) {
533533
Environment* env = Environment::GetCurrent(info);
534-
Local<Value> proto = info.This()->GetPrototypeV2();
534+
Local<Value> proto = info.HolderV2()->GetPrototypeV2();
535535

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

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

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

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

587587
Storage* storage;
588-
ASSIGN_OR_RETURN_UNWRAP(&storage, info.This(), Intercepted::kNo);
588+
ASSIGN_OR_RETURN_UNWRAP(&storage, info.HolderV2(), Intercepted::kNo);
589589
Local<Value> result;
590590
if (!storage->Load(property).ToLocal(&result) || result->IsNull()) {
591591
return Intercepted::kNo;
@@ -598,7 +598,7 @@ static Intercepted StorageQuery(Local<Name> property,
598598
static Intercepted StorageDeleter(Local<Name> property,
599599
const PropertyCallbackInfo<Boolean>& info) {
600600
Storage* storage;
601-
ASSIGN_OR_RETURN_UNWRAP(&storage, info.This(), Intercepted::kNo);
601+
ASSIGN_OR_RETURN_UNWRAP(&storage, info.HolderV2(), Intercepted::kNo);
602602

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

@@ -607,7 +607,7 @@ static Intercepted StorageDeleter(Local<Name> property,
607607

608608
static void StorageEnumerator(const PropertyCallbackInfo<Array>& info) {
609609
Storage* storage;
610-
ASSIGN_OR_RETURN_UNWRAP(&storage, info.This());
610+
ASSIGN_OR_RETURN_UNWRAP(&storage, info.HolderV2());
611611
Local<Array> result;
612612
if (!storage->Enumerate().ToLocal(&result)) {
613613
return;
@@ -619,7 +619,7 @@ static Intercepted StorageDefiner(Local<Name> property,
619619
const PropertyDescriptor& desc,
620620
const PropertyCallbackInfo<void>& info) {
621621
Storage* storage;
622-
ASSIGN_OR_RETURN_UNWRAP(&storage, info.This(), Intercepted::kNo);
622+
ASSIGN_OR_RETURN_UNWRAP(&storage, info.HolderV2(), Intercepted::kNo);
623623

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

0 commit comments

Comments
 (0)