Skip to content

Commit 490bac2

Browse files
gahaasvictorgomes
authored andcommitted
Use Object::Wrap only with v8::Object::Wrappable*
1 parent b72a615 commit 490bac2

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/cppgc_helpers-inl.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ void CppgcMixin::Wrap(T* ptr, Realm* realm, v8::Local<v8::Object> obj) {
1515
v8::Isolate* isolate = realm->isolate();
1616
ptr->traced_reference_ = v8::TracedReference<v8::Object>(isolate, obj);
1717
// Note that ptr must be of concrete type T in Wrap.
18-
v8::Object::Wrap<v8::CppHeapPointerTag::kDefaultTag>(isolate, obj, ptr);
18+
auto* wrappable = static_cast<v8::Object::Wrappable*>(ptr);
19+
v8::Object::Wrap<v8::CppHeapPointerTag::kDefaultTag>(isolate, obj, wrappable);
1920
// Keep the layout consistent with BaseObjects.
2021
obj->SetAlignedPointerInInternalField(
2122
kEmbedderType, realm->isolate_data()->embedder_id_for_cppgc());

src/cppgc_helpers.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ class CppgcMixin : public cppgc::GarbageCollectedMixin, public MemoryRetainer {
155155
*/
156156
#define CPPGC_MIXIN(Klass) \
157157
public /* NOLINT(whitespace/indent) */ \
158-
cppgc::GarbageCollected<Klass>, public cppgc::NameProvider, public CppgcMixin
158+
v8::Object::Wrappable, public CppgcMixin
159159

160160
#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
161161

0 commit comments

Comments
 (0)