ReviewOS

zig-utils/zig-js

ABI: implement exact private property iteration

#368
Closed chris opened this 9 days ago ·
9 days ago

Parent: #134 Related: #140, #163, #164

Implement the shared JavaScriptCore-compatible private property-iterator boundary used by the pinned Home and Bun consumers. This is one ownership and observability contract spanning six exports, so it should land atomically rather than as disconnected stubs.

Acceptance:

  • Export Bun__JSPropertyIterator__create, deinit, getLongestPropertyName, getName, getNameAndValue, and getNameAndValueNonObservable with the exact pinned signatures.
  • Snapshot enumerable property names in engine order, including inherited enumerable names when requested, with PropertyNameArray-style duplicate suppression and explicit own-only/non-index behavior.
  • Exclude private names while preserving supported public Symbol-key semantics.
  • Make getNameAndValue perform observable ordinary property access, including prototype lookup, getter execution, Proxy behavior, and pending-exception publication.
  • Make getNameAndValueNonObservable perform a pure VM inquiry: it may walk direct ordinary prototypes, but must return empty at accessors, proxies, custom/opaque slots, or absence without invoking user code.
  • Preserve snapshotted names across later object mutation, expose stable borrowed BunString views for iterator use, and compute longest length in UTF-16 code units.
  • Retain the iterator VM through deinit, enforce VM affinity, and handle invalid indices safely without leaking iterator-owned storage.
  • Add focused engine tests plus compiled Home/Bun consumer coverage in Debug and ReleaseSafe.
  • Refresh both generated private-ABI inventories and update the parent issues with exact evidence.
9 days ago

Implemented and pushed directly to main in 4be4789d; the consumer evidence label was corrected in 01cfa77b.

Evidence:

  • all six exact pinned exports are present and both inventories refresh cleanly;
  • Home: 352/471 private implemented, 119 pending, zero unclassified;
  • Bun: 344/461 private implemented, 117 pending, zero unclassified;
  • focused engine test: 3/3 in Debug and ReleaseSafe, zero leaks;
  • independently compiled Home consumer: 339/339 linked and runtime matrix passed in Debug and ReleaseSafe;
  • dedicated Bun property-iterator consumer: compile/link/runtime passed in Debug and ReleaseSafe;
  • CI private-ABI boundary now runs the Bun fixture.

Coverage includes exact enumerable ordering and PropertyNameArray de-duplication, own/inherited and non-index modes, public Symbols/private exclusion, observable Proxy/getter/throw behavior, pure VM inquiry (including typed-array numeric exotic semantics), live values over stable name snapshots, UTF-16 length, sibling/foreign VM affinity, invalid indices, and iterator-retained VM teardown.

Sign in to comment on this issue.