Skip to content

Commit

Permalink
fixup! src: remove dependency on wrapper-descriptor-based cpp heap
Browse files Browse the repository at this point in the history
  • Loading branch information
joyeecheung committed May 20, 2024
1 parent 312da71 commit 144cd73
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
3 changes: 3 additions & 0 deletions src/node.h
Original file line number Diff line number Diff line change
Expand Up @@ -1563,6 +1563,9 @@ void RegisterSignalHandler(int signal,
bool reset_handler = false);
#endif // _WIN32

// This is kept as a compatibility layer for addons to wrap cppgc-managed objects
// on Node.js versions without v8::Object::Wrap(). Addons created to work with
// only Node.js versions with v8::Object::Wrap() should use that instead.
NODE_DEPRECATED("Use v8::Object::Wrap()",
NODE_EXTERN void SetCppgcReference(v8::Isolate* isolate,
v8::Local<v8::Object> object,
Expand Down
3 changes: 1 addition & 2 deletions test/addons/cppgc-object/binding.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ class CppGCed : public cppgc::GarbageCollected<CppGCed> {
assert(heap != nullptr);
CppGCed* gc_object =
cppgc::MakeGarbageCollected<CppGCed>(heap->GetAllocationHandle());
v8::Object::Wrap<v8::CppHeapPointerTag::kDefaultTag>(
isolate, js_object, gc_object);
node::SetCppgcReference(isolate, js_object, gc_object);
args.GetReturnValue().Set(js_object);
}

Expand Down
3 changes: 1 addition & 2 deletions test/cctest/test_cppgc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ class CppGCed : public cppgc::GarbageCollected<CppGCed> {
CHECK_NOT_NULL(heap);
CppGCed* gc_object =
cppgc::MakeGarbageCollected<CppGCed>(heap->GetAllocationHandle());
v8::Object::Wrap<v8::CppHeapPointerTag::kDefaultTag>(
isolate, js_object, gc_object);
node::SetCppgcReference(isolate, js_object, gc_object);
kConstructCount++;
args.GetReturnValue().Set(js_object);
}
Expand Down

0 comments on commit 144cd73

Please sign in to comment.