Parent
Scope
Implement ZigString__toDOMExceptionInstance against the complete pinned u8 WebCore::ExceptionCode contract, not only AbortError/TimeoutError.
Evidence sources:
- Home/Bun
DOMExceptionCodeenum ordering (0-40); - Bun
JSDOMExceptionHandling.cppat4982b91efor special JS Error branches; - WebKit
DOMException.cppdescription table for DOM names, default messages, and legacy codes.
Required behavior:
- codes 0-31: exact DOM names/default messages/legacy codes, except Bun's intentional code-9 JS SyntaxError divergence;
- codes 32-40: RangeError, TypeError, JS SyntaxError, stack/OOM/existing-exception, invalid-this, invalid-URL, and crypto branches;
- non-empty ZigString messages override DOM defaults;
- selected-realm prototypes, freshness, tagged encodings, and first-exception/OOM behavior;
- invalid/unrecognized codes must have an explicit tested disposition.
Acceptance
- Every pinned enum value has a table-driven fixture row.
- DOM names, messages, legacy codes, and special JS Error classes match pinned Bun/WebKit behavior.
- Both inventories, focused runtime, README/docs, and parent issues are current.
Completion evidence
Implemented on main in a37d2f0b; README and ABI documentation published in f8ef4b7c.
- All codes 0-40 have table-driven runtime coverage, including exact WebCore metadata and the intentional Bun code-9 SyntaxError divergence.
- Special RangeError, TypeError, Error, undefined, and Node-style code branches match the pinned Bun source.
- Non-empty UTF-16 messages override defaults; unknown code 255 uses the pinned empty-name DOMException fallback.
- Selected-realm prototypes, same-VM sibling realms, tagged Latin-1/UTF-16 input, lone surrogates, freshness, and first-exception preservation are exercised.
zig build test-home-private-abi -Doptimize=Debugpasses 89/89 symbols.- Home audit: 91/431 implemented, 340 pending. Bun core audit: 84/421 implemented, 337 pending.