@@ -639,7 +639,7 @@ struct GetterCallback;
639639 liftKj (info, [&]() { \
640640 auto isolate = info.GetIsolate (); \
641641 auto context = isolate->GetCurrentContext (); \
642- auto obj = info.This (); \
642+ auto obj = info.HolderV2 (); \
643643 auto & js = Lock::from (isolate); \
644644 auto & wrapper = TypeWrapper::from (isolate); \
645645 /* V8 no longer supports AccessorSignature, so we must manually verify `this`'s type. */ \
@@ -686,7 +686,7 @@ struct GetterCallback;
686686 auto isolate = info.GetIsolate (); \
687687 auto context = isolate->GetCurrentContext (); \
688688 auto & js = Lock::from (isolate); \
689- auto obj = info.This (); \
689+ auto obj = info.HolderV2 (); \
690690 auto & wrapper = TypeWrapper::from (isolate); \
691691 /* V8 no longer supports AccessorSignature, so we must manually verify `this`'s type. */ \
692692 if (!isContext && \
@@ -884,9 +884,7 @@ struct SetterCallback<TypeWrapper, methodName, void (T::*)(Arg), method, isConte
884884 auto isolate = info.GetIsolate ();
885885 auto context = isolate->GetCurrentContext ();
886886 auto & js = Lock::from (isolate);
887- // TODO(soon): resolve .This() -> .HolderV2() deprecation message. When doing so, please
888- // also remove the "#pragma clang diagnostic ignored "-Wdeprecated-declarations"" above.
889- auto obj = info.This ();
887+ auto obj = info.HolderV2 ();
890888 auto & wrapper = TypeWrapper::from (isolate);
891889 // V8 no longer supports AccessorSignature, so we must manually verify `this`'s type.
892890 if (!isContext && !wrapper.getTemplate (isolate, static_cast <T*>(nullptr ))->HasInstance (obj)) {
@@ -912,7 +910,7 @@ struct SetterCallback<TypeWrapper, methodName, void (T::*)(Lock&, Arg), method,
912910 liftKj (info, [&]() {
913911 auto isolate = info.GetIsolate ();
914912 auto context = isolate->GetCurrentContext ();
915- auto obj = info.This ();
913+ auto obj = info.HolderV2 ();
916914 auto & wrapper = TypeWrapper::from (isolate);
917915 // V8 no longer supports AccessorSignature, so we must manually verify `this`'s type.
918916 if (!isContext && !wrapper.getTemplate (isolate, static_cast <T*>(nullptr ))->HasInstance (obj)) {
@@ -1449,15 +1447,16 @@ struct ResourceTypeBuilder {
14491447
14501448 template <const char * name, typename Getter, Getter getter>
14511449 inline void registerInspectProperty () {
1452- using Gcb = GetterCallback <TypeWrapper, name, Getter, getter, isContext>;
1450+ using Gcb = PropertyGetterCallback <TypeWrapper, name, Getter, getter, isContext>;
14531451
14541452 auto v8Name = v8StrIntern (isolate, name);
14551453
14561454 // Create a new unique symbol so this property can only be accessed through `util.inspect()`
14571455 auto symbol = v8::Symbol::New (isolate, v8Name);
14581456 inspectProperties->Set (v8Name, symbol, v8::PropertyAttribute::ReadOnly);
14591457
1460- prototype->SetNativeDataProperty (symbol, &Gcb::callback, nullptr , v8::Local<v8::Value>(),
1458+ auto getterFn = v8::FunctionTemplate::New (isolate, &Gcb::callback);
1459+ prototype->SetAccessorProperty (symbol, getterFn, {},
14611460 static_cast <v8::PropertyAttribute>(
14621461 v8::PropertyAttribute::ReadOnly | v8::PropertyAttribute::DontEnum));
14631462 }
0 commit comments