ReviewOS

zig-utils/zig-js

ABI: implement private JSArray constructors

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

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

Implement the shared private JSArray construction boundary used directly by both pinned consumers.

Acceptance:

  • Export exact JSArray__constructArray and JSArray__constructEmptyArray signatures.
  • Construct fresh selected-realm arrays from a contiguous encoded-value slice in order, with packed own elements and exact length.
  • Construct fresh selected-realm empty arrays with exact logical holes for zero through maximum-u32 lengths.
  • Preserve immediate and owned-cell identity, including sibling-realm values from the same VM.
  • Publish invalid length, foreign-value, allocation, and abrupt failures through #180 VM pending exceptions with an empty return.
  • Reject foreign-VM values safely without publishing a partially constructed array.
  • Cover exact signatures, order, identity, holes, realm prototypes, sibling values, maximum lengths, and failure atomicity 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: 51bd16e1 (feat(abi): add private JSArray constructors)
  • published ABI/README evidence: 7d522d3b
  • focused private runtime fixture: 47/47 symbols linked and passed
  • Home inventory: 49/432 implemented, 383 pending
  • Bun core inventory: 49/422 implemented, 373 pending
  • public/extension accounting remains 117/19
  • public C and Bun inventory audits pass with zero drift

The fixture covers packed order, immediate and owned-cell identity, same-VM sibling values, selected-realm Array.prototype, hole-only zero/max-u32 lengths, foreign-value TypeError publication, invalid-length exception publication, and no partially exposed result.

Sign in to comment on this issue.