ReviewOS

zig-utils/zig-js

ABI: implement private arrays and indexed access

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

Parents: #163, #164 Depends on: #180

Implement the shared private array construction and indexed-access boundary.

Acceptance:

  • Export exact JSC__JSValue__createEmptyArray, JSC__JSValue__putIndex, JSC__JSValue__push, JSC__JSValue__getDirectIndex, and JSC__JSObject__getIndex signatures.
  • Create fresh selected-realm arrays with exact logical length and holes, including zero and maximum u32 lengths.
  • Perform direct index writes and pushes without invoking inherited setters, while preserving sparse gaps and array length.
  • Return the empty JSC64 value for absent direct indices and preserve present undefined as a distinct non-empty value.
  • Make observable indexed reads perform ToObject/prototype/getter semantics and publish thrown values through #180's VM pending-exception cell.
  • Publish RangeError/OOM failures through the same empty-result iff pending-exception invariant.
  • Reject invalid, foreign-context, and non-array mutation inputs safely.
  • Cover exact signatures, holes, sparse writes, maximum lengths, inherited getters/setters, thrown getters, and sibling-realm exception visibility in the compile-link-runtime fixture.
  • Update both inventories and README/API documentation without changing public/extension counts.
9 days ago

Implemented and documented on main.

Evidence:

  • implementation: 7e92e161 (feat(abi): add private array index operations)
  • published ABI/README evidence: f91d90ca
  • focused private runtime fixture: 45/45 symbols linked and passed
  • Home inventory: 47/432 implemented, 385 pending
  • Bun core inventory: 47/422 implemented, 375 pending
  • public/extension accounting remains 117/19

The runtime matrix covers holes versus present undefined, inherited getter visibility, inherited setter bypass, sibling-realm exception visibility, sparse growth, index/length u32 boundaries, RangeError publication, primitive ToObject, and foreign/invalid inputs.

Sign in to comment on this issue.