Parent
Scope
Implement the eight shared pinned reference imports:
Bun__StrongRef__clear
Bun__StrongRef__delete
Bun__StrongRef__new
Bun__StrongRef__set
Bun__WeakRef__clear
Bun__WeakRef__delete
Bun__WeakRef__get
Bun__WeakRef__new
Acceptance criteria
- Strong references retain the exact value across full and nursery collection, and
set atomically replaces the rooted value without leaking the previous root.
- Weak references never retain their target, clear after collection when no strong path remains, and return the exact live value beforehand.
- Primitive, object, symbol, empty, and null/invalid inputs follow the pinned consumer boundary without manufacturing foreign-VM values.
- Reference wrappers record and enforce owning VM/global lifetime; cross-VM replacement is rejected deterministically.
clear and delete are idempotent where the consumer contract permits it, are safe after target collection, and do not leave collector-visible stale pointers.
- The pinned
WeakRefType and optional context are preserved for future callback/lifecycle behavior rather than discarded accidentally.
- Concurrent root tracing versus set/clear/get/delete is synchronized and covered without collector or wrapper use-after-free.
- Focused precise-GC, lifecycle, invalid-input, and multi-VM tests pass; Home/Bun inventories, combined fixture, API docs, README evidence, and parent trackers are regenerated.
Parent
Scope
Implement the eight shared pinned reference imports:
Bun__StrongRef__clearBun__StrongRef__deleteBun__StrongRef__newBun__StrongRef__setBun__WeakRef__clearBun__WeakRef__deleteBun__WeakRef__getBun__WeakRef__newAcceptance criteria
setatomically replaces the rooted value without leaking the previous root.clearanddeleteare idempotent where the consumer contract permits it, are safe after target collection, and do not leave collector-visible stale pointers.WeakRefTypeand optional context are preserved for future callback/lifecycle behavior rather than discarded accidentally.