Skip to content

Commit d8ae939

Browse files
Update AppWrapper.h
1 parent 3dda2d6 commit d8ae939

File tree

1 file changed

+36
-36
lines changed

1 file changed

+36
-36
lines changed

src/AppWrapper.h

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ void uWS_App_ws(const FunctionCallbackInfo<Value> &args) {
3333

3434
PerContextData *perContextData = (PerContextData *) Local<External>::Cast(args.Data())->Value();
3535

36-
APP *app = (APP *) args.Holder()->GetAlignedPointerFromInternalField(0);
36+
APP *app = (APP *) args.This()->GetAlignedPointerFromInternalField(0);
3737
/* This one is default constructed with defaults */
3838
typename APP::template WebSocketBehavior<PerSocketData> behavior = {};
3939

@@ -293,13 +293,13 @@ void uWS_App_ws(const FunctionCallbackInfo<Value> &args) {
293293
app->template ws<PerSocketData>(std::string(pattern.getString()), std::move(behavior));
294294

295295
/* Return this */
296-
args.GetReturnValue().Set(args.Holder());
296+
args.GetReturnValue().Set(args.This());
297297
}
298298

299299
/* This method wraps get, post and all http methods */
300300
template <typename APP, typename F>
301301
void uWS_App_get(F f, const FunctionCallbackInfo<Value> &args) {
302-
APP *app = (APP *) args.Holder()->GetAlignedPointerFromInternalField(0);
302+
APP *app = (APP *) args.This()->GetAlignedPointerFromInternalField(0);
303303

304304
/* Pattern */
305305
NativeString pattern(args.GetIsolate(), args[0]);
@@ -310,7 +310,7 @@ void uWS_App_get(F f, const FunctionCallbackInfo<Value> &args) {
310310
/* If the handler is null */
311311
if (args[1]->IsNull()) {
312312
(app->*f)(std::string(pattern.getString()), nullptr);
313-
args.GetReturnValue().Set(args.Holder());
313+
args.GetReturnValue().Set(args.This());
314314
return;
315315
}
316316

@@ -421,7 +421,7 @@ void uWS_App_get(F f, const FunctionCallbackInfo<Value> &args) {
421421

422422
});
423423

424-
args.GetReturnValue().Set(args.Holder());
424+
args.GetReturnValue().Set(args.This());
425425
return;
426426
}
427427

@@ -455,20 +455,20 @@ void uWS_App_get(F f, const FunctionCallbackInfo<Value> &args) {
455455
* onAborted handler, so we can assume it's done */
456456
});
457457

458-
args.GetReturnValue().Set(args.Holder());
458+
args.GetReturnValue().Set(args.This());
459459
}
460460

461461
template <typename APP>
462462
void uWS_App_close(const FunctionCallbackInfo<Value> &args) {
463-
APP *app = (APP *) args.Holder()->GetAlignedPointerFromInternalField(0);
463+
APP *app = (APP *) args.This()->GetAlignedPointerFromInternalField(0);
464464

465465
app->close();
466-
args.GetReturnValue().Set(args.Holder());
466+
args.GetReturnValue().Set(args.This());
467467
}
468468

469469
template <typename APP>
470470
void uWS_App_listen_unix(const FunctionCallbackInfo<Value> &args) {
471-
APP *app = (APP *) args.Holder()->GetAlignedPointerFromInternalField(0);
471+
APP *app = (APP *) args.This()->GetAlignedPointerFromInternalField(0);
472472

473473
Isolate *isolate = args.GetIsolate();
474474

@@ -497,12 +497,12 @@ void uWS_App_listen_unix(const FunctionCallbackInfo<Value> &args) {
497497

498498
app->listen(std::move(cb), path);
499499

500-
args.GetReturnValue().Set(args.Holder());
500+
args.GetReturnValue().Set(args.This());
501501
}
502502

503503
template <typename APP>
504504
void uWS_App_listen(const FunctionCallbackInfo<Value> &args) {
505-
APP *app = (APP *) args.Holder()->GetAlignedPointerFromInternalField(0);
505+
APP *app = (APP *) args.This()->GetAlignedPointerFromInternalField(0);
506506

507507
Isolate *isolate = args.GetIsolate();
508508

@@ -539,12 +539,12 @@ void uWS_App_listen(const FunctionCallbackInfo<Value> &args) {
539539
app->listen(host, numbers.size() ? numbers[0] : 0,
540540
numbers.size() > 1 ? numbers[1] : 0, std::move(cb));
541541

542-
args.GetReturnValue().Set(args.Holder());
542+
args.GetReturnValue().Set(args.This());
543543
}
544544

545545
template <typename APP>
546546
void uWS_App_filter(const FunctionCallbackInfo<Value> &args) {
547-
APP *app = (APP *) args.Holder()->GetAlignedPointerFromInternalField(0);
547+
APP *app = (APP *) args.This()->GetAlignedPointerFromInternalField(0);
548548

549549
/* Handler */
550550
Callback checkedCallback(args.GetIsolate(), args[0]);
@@ -567,12 +567,12 @@ void uWS_App_filter(const FunctionCallbackInfo<Value> &args) {
567567
CallJS(isolate, cb.Get(isolate), 2, argv);
568568
});
569569

570-
args.GetReturnValue().Set(args.Holder());
570+
args.GetReturnValue().Set(args.This());
571571
}
572572

573573
template <typename APP>
574574
void uWS_App_domain(const FunctionCallbackInfo<Value> &args) {
575-
APP *app = (APP *) args.Holder()->GetAlignedPointerFromInternalField(0);
575+
APP *app = (APP *) args.This()->GetAlignedPointerFromInternalField(0);
576576

577577
Isolate *isolate = args.GetIsolate();
578578

@@ -588,12 +588,12 @@ void uWS_App_domain(const FunctionCallbackInfo<Value> &args) {
588588

589589
app->domain(std::string(serverName.getString()));
590590

591-
args.GetReturnValue().Set(args.Holder());
591+
args.GetReturnValue().Set(args.This());
592592
}
593593

594594
template <typename APP>
595595
void uWS_App_publish(const FunctionCallbackInfo<Value> &args) {
596-
APP *app = (APP *) args.Holder()->GetAlignedPointerFromInternalField(0);
596+
APP *app = (APP *) args.This()->GetAlignedPointerFromInternalField(0);
597597

598598
Isolate *isolate = args.GetIsolate();
599599

@@ -619,7 +619,7 @@ void uWS_App_publish(const FunctionCallbackInfo<Value> &args) {
619619

620620
template <typename APP>
621621
void uWS_App_numSubscribers(const FunctionCallbackInfo<Value> &args) {
622-
APP *app = (APP *) args.Holder()->GetAlignedPointerFromInternalField(0);
622+
APP *app = (APP *) args.This()->GetAlignedPointerFromInternalField(0);
623623

624624
Isolate *isolate = args.GetIsolate();
625625

@@ -715,20 +715,20 @@ std::pair<uWS::SocketContextOptions, bool> readOptionsObject(const FunctionCallb
715715

716716
template <typename APP>
717717
void uWS_App_adoptSocket(const FunctionCallbackInfo<Value> &args) {
718-
APP *app = (APP *) args.Holder()->GetAlignedPointerFromInternalField(0);
718+
APP *app = (APP *) args.This()->GetAlignedPointerFromInternalField(0);
719719

720720
Isolate *isolate = args.GetIsolate();
721721

722722
int32_t fd = args[0]->Int32Value(isolate->GetCurrentContext()).ToChecked();
723723

724724
app->adoptSocket(fd);
725725

726-
args.GetReturnValue().Set(args.Holder());
726+
args.GetReturnValue().Set(args.This());
727727
}
728728

729729
template <typename APP>
730730
void uWS_App_removeChildApp(const FunctionCallbackInfo<Value> &args) {
731-
APP *app = (APP *) args.Holder()->GetAlignedPointerFromInternalField(0);
731+
APP *app = (APP *) args.This()->GetAlignedPointerFromInternalField(0);
732732

733733
Isolate *isolate = args.GetIsolate();
734734

@@ -739,12 +739,12 @@ void uWS_App_removeChildApp(const FunctionCallbackInfo<Value> &args) {
739739

740740
app->removeChildApp(receivingApp);
741741

742-
args.GetReturnValue().Set(args.Holder());
742+
args.GetReturnValue().Set(args.This());
743743
}
744744

745745
template <typename APP>
746746
void uWS_App_addChildApp(const FunctionCallbackInfo<Value> &args) {
747-
APP *app = (APP *) args.Holder()->GetAlignedPointerFromInternalField(0);
747+
APP *app = (APP *) args.This()->GetAlignedPointerFromInternalField(0);
748748

749749
Isolate *isolate = args.GetIsolate();
750750

@@ -755,19 +755,19 @@ void uWS_App_addChildApp(const FunctionCallbackInfo<Value> &args) {
755755

756756
memcpy(&receivingApp, &descriptor, sizeof(receivingApp));
757757

758-
/* Todo: check the class type of args[0] must match class type of args.Holder() */
758+
/* Todo: check the class type of args[0] must match class type of args.This() */
759759
//if (args[0])
760760

761761
//std::cout << "addChildApp: " << receivingApp << std::endl;
762762

763763
app->addChildApp(receivingApp);
764764

765-
args.GetReturnValue().Set(args.Holder());
765+
args.GetReturnValue().Set(args.This());
766766
}
767767

768768
template <typename APP>
769769
void uWS_App_getDescriptor(const FunctionCallbackInfo<Value> &args) {
770-
APP *app = (APP *) args.Holder()->GetAlignedPointerFromInternalField(0);
770+
APP *app = (APP *) args.This()->GetAlignedPointerFromInternalField(0);
771771

772772
Isolate *isolate = args.GetIsolate();
773773

@@ -776,7 +776,7 @@ void uWS_App_getDescriptor(const FunctionCallbackInfo<Value> &args) {
776776
//static thread_local std::unordered_set<UniquePersistent<Object>> persistentApps;
777777

778778
UniquePersistent<Object> *persistentApp = new UniquePersistent<Object>;
779-
persistentApp->Reset(args.GetIsolate(), args.Holder());
779+
persistentApp->Reset(args.GetIsolate(), args.This());
780780

781781
//persistentApps.emplace(persistentApp);
782782

@@ -792,7 +792,7 @@ void uWS_App_getDescriptor(const FunctionCallbackInfo<Value> &args) {
792792

793793
template <typename APP>
794794
void uWS_App_addServerName(const FunctionCallbackInfo<Value> &args) {
795-
APP *app = (APP *) args.Holder()->GetAlignedPointerFromInternalField(0);
795+
APP *app = (APP *) args.This()->GetAlignedPointerFromInternalField(0);
796796

797797
Isolate *isolate = args.GetIsolate();
798798
NativeString hostnamePatternValue(isolate, args[0]);
@@ -811,12 +811,12 @@ void uWS_App_addServerName(const FunctionCallbackInfo<Value> &args) {
811811

812812
app->addServerName(hostnamePattern.c_str(), options);
813813

814-
args.GetReturnValue().Set(args.Holder());
814+
args.GetReturnValue().Set(args.This());
815815
}
816816

817817
template <typename APP>
818818
void uWS_App_removeServerName(const FunctionCallbackInfo<Value> &args) {
819-
APP *app = (APP *) args.Holder()->GetAlignedPointerFromInternalField(0);
819+
APP *app = (APP *) args.This()->GetAlignedPointerFromInternalField(0);
820820

821821
Isolate *isolate = args.GetIsolate();
822822
NativeString hostnamePatternValue(isolate, args[0]);
@@ -830,12 +830,12 @@ void uWS_App_removeServerName(const FunctionCallbackInfo<Value> &args) {
830830

831831
app->removeServerName(hostnamePattern.c_str());
832832

833-
args.GetReturnValue().Set(args.Holder());
833+
args.GetReturnValue().Set(args.This());
834834
}
835835

836836
template <typename APP>
837837
void uWS_App_missingServerName(const FunctionCallbackInfo<Value> &args) {
838-
APP *app = (APP *) args.Holder()->GetAlignedPointerFromInternalField(0);
838+
APP *app = (APP *) args.This()->GetAlignedPointerFromInternalField(0);
839839
Isolate *isolate = args.GetIsolate();
840840

841841
UniquePersistent<Function> missingPf;
@@ -849,7 +849,7 @@ void uWS_App_missingServerName(const FunctionCallbackInfo<Value> &args) {
849849
CallJS(isolate, missingLf, 1, argv);
850850
});
851851

852-
args.GetReturnValue().Set(args.Holder());
852+
args.GetReturnValue().Set(args.This());
853853
}
854854

855855
template <typename APP>
@@ -899,7 +899,7 @@ void uWS_App(const FunctionCallbackInfo<Value> &args) {
899899
std::cout << "Registering cached get handler" << std::endl;
900900

901901

902-
APP *app = (APP *) args.Holder()->GetAlignedPointerFromInternalField(0);
902+
APP *app = (APP *) args.This()->GetAlignedPointerFromInternalField(0);
903903

904904
/* Pattern */
905905
NativeString pattern(args.GetIsolate(), args[0]);
@@ -939,7 +939,7 @@ void uWS_App(const FunctionCallbackInfo<Value> &args) {
939939
* onAborted handler, so we can assume it's done */
940940
}/*, 13*/);
941941

942-
args.GetReturnValue().Set(args.Holder());
942+
args.GetReturnValue().Set(args.This());
943943

944944

945945
} else {
@@ -1036,4 +1036,4 @@ void uWS_App(const FunctionCallbackInfo<Value> &args) {
10361036

10371037
args.GetReturnValue().Set(localApp);
10381038

1039-
}
1039+
}

0 commit comments

Comments
 (0)