diff --git a/src/cppgc_helpers-inl.h b/src/cppgc_helpers-inl.h index 745ecab746f7c7..330af7a383058c 100644 --- a/src/cppgc_helpers-inl.h +++ b/src/cppgc_helpers-inl.h @@ -15,7 +15,8 @@ void CppgcMixin::Wrap(T* ptr, Realm* realm, v8::Local obj) { v8::Isolate* isolate = realm->isolate(); ptr->traced_reference_ = v8::TracedReference(isolate, obj); // Note that ptr must be of concrete type T in Wrap. - v8::Object::Wrap(isolate, obj, ptr); + auto* wrappable = static_cast(ptr); + v8::Object::Wrap(isolate, obj, wrappable); // Keep the layout consistent with BaseObjects. obj->SetAlignedPointerInInternalField( kEmbedderType, realm->isolate_data()->embedder_id_for_cppgc()); diff --git a/src/cppgc_helpers.h b/src/cppgc_helpers.h index fb2af584a4ae77..fe6300a5d5d2d6 100644 --- a/src/cppgc_helpers.h +++ b/src/cppgc_helpers.h @@ -155,7 +155,7 @@ class CppgcMixin : public cppgc::GarbageCollectedMixin, public MemoryRetainer { */ #define CPPGC_MIXIN(Klass) \ public /* NOLINT(whitespace/indent) */ \ - cppgc::GarbageCollected, public cppgc::NameProvider, public CppgcMixin + v8::Object::Wrappable, public CppgcMixin #endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS