ReviewOS

zig-utils/zig-js

ABI: construct selected-realm Error instances from ZigString

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

Parent

Scope

Use #196's exact pointer-tagged ZigString decoder to implement the four shared non-DOM error constructors:

  • ZigString__toErrorInstance;
  • ZigString__toTypeErrorInstance;
  • ZigString__toRangeErrorInstance;
  • ZigString__toSyntaxErrorInstance.

ZigString__toDOMExceptionInstance remains separate because its numeric WebCore ExceptionCode mapping is a distinct contract.

Acceptance

  • All four shared imports are implemented.
  • Freshness, name/message, instanceof Error, and exact realm prototypes are covered.
  • Pointer-tagged encodings and first-exception preservation are covered.
  • Focused fixture, both audits, README/docs, and parent issues are current.

Evidence

Implemented in 6678abef; documentation published in cf95a7bd.

  • zig build test-home-private-abi -Doptimize=Debug: 88/88 combined symbols linked and runtime matrix passed.
  • Both pinned audits pass: Home 90/431 implemented (341 pending); Bun 83/421 implemented (338 pending).
  • Runtime coverage proves fresh Error/TypeError/RangeError/SyntaxError objects, exact names/messages, Error inheritance, immutable internal kind classification, selected-realm intrinsic prototypes, Latin-1/UTF-8/UTF-16/empty/astral/lone-surrogate inputs, and first-pending-exception preservation.
9 days ago

Completed on main in 6678abef (implementation/inventories/88-symbol fixture) and cf95a7bd (README and ABI/integration/API evidence). Focused runtime and both pinned audits pass. Current status: Home 90/431 implemented (341 pending); Bun 83/421 implemented (338 pending). Parents #134, #140, #163, and #164 are updated.

Sign in to comment on this issue.