ReviewOS

zig-utils/zig-js

ABI: implement exact CommonAbortReason DOMException conversion

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

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

Problem

The shared pinned Home/Bun symbol WebCore__CommonAbortReason__toJS is still pending even though zig-js already has selected-realm DOMException construction with exact name/message/code metadata.

Pinned contract

Bun revision 4982b91e maps the three CommonAbortReason tags as follows:

  • Timeout (1) -> TimeoutError: The operation timed out.
  • UserAbort (2) -> AbortError: The operation was aborted.
  • ConnectionClosed (3) -> AbortError: The connection was closed.

The result must be a fresh DOMException in the requested realm, inherit that realm DOMException prototype, expose the matching legacy code (23 or 20), and publish allocation failure through the existing VM exception boundary.

Acceptance criteria

  • Export the exact shared symbol and enum-width ABI.
  • Preserve selected-realm prototype identity, DOMException/Error classification, exact names/messages/codes, and freshness.
  • Keep an already-pending VM exception intact and avoid allocation/mutation in that state.
  • Add the symbol to the combined private runtime fixture.
  • Refresh Home/Bun inventories, README and ABI docs.
  • Pass the focused runtime fixture and batched ABI audits.
9 days ago

Completed on main in 880e3df4 with documentation in d195ee06.

Evidence:

  • exact enum(u8) tags 1/2/3 and Bun-pinned TimeoutError/AbortError messages
  • fresh selected-realm DOMException prototype and Error inheritance
  • exact legacy codes 23/20
  • first pending VM exception preserved without allocation
  • 79/79 combined private runtime symbols pass
  • Home is 81 implemented / 350 pending of 431 private imports
  • Bun core is 74 implemented / 347 pending of 421 private imports
  • focused runtime fixture and both pinned ABI audits pass
  • README and ABI/integration docs updated

Linked from #163, #164, #140, and #134.

Sign in to comment on this issue.