ReviewOS

zig-utils/zig-js

ABI: implement exact AggregateError construction and access

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

Parent

Scope

Implement the three shared pinned AggregateError bridges:

  • JSC__JSGlobalObject__createAggregateError from an encoded error slice and ZigString message.
  • JSC__JSGlobalObject__createAggregateErrorWithArray from an existing exact JSArray, by-value BunString message, and optional cause.
  • JSC__JSValue__getErrorsProperty as a direct own-property read that bypasses mutable prototypes/getters.

Acceptance

  • Slice construction preserves order and exact value identity in a fresh selected-realm errors array.
  • Existing-array construction preserves the exact array object and cause identity.
  • Message decoding covers tagged ZigString and BunString representations, including lone surrogates.
  • errors/message/cause descriptors and immutable AggregateError classification match pinned behavior.
  • Same-VM siblings, foreign values, invalid arrays, failure atomicity, and first-exception preservation are covered.
  • Focused runtime, both inventories, README/docs, and parent trackers are current.

Completion evidence

Implemented on main in 454b9d5e; README and ABI documentation published in ff808cd9.

  • Slice construction preserves order and exact value identity in a fresh selected-realm errors array.
  • Existing-array construction preserves the exact array and optional cause identities.
  • Tagged ZigString and by-value BunString messages cover astral and lone-surrogate text.
  • message/errors/cause descriptors are writable, non-enumerable, and configurable; AggregateError classification uses immutable metadata.
  • Direct errors reads bypass prototypes; siblings, foreign inputs, invalid arrays, failure atomicity, and first exceptions are covered.
  • zig build test-home-private-abi -Doptimize=Debug passes 103/103 symbols.
  • Home audit: 105/431 implemented, 326 pending. Bun core audit: 98/421 implemented, 323 pending.
9 days ago

Completed on main in 454b9d5 with documentation in ff808cd. Focused runtime: 103/103; Home: 105/431; Bun core: 98/421.

Sign in to comment on this issue.