Parent
Scope
Implement ZigString__toDOMExceptionInstance against the complete pinned u8 WebCore::ExceptionCode contract, not only AbortError/TimeoutError.
Evidence sources:
- Home/Bun
DOMExceptionCode enum ordering (0-40);
- Bun
JSDOMExceptionHandling.cpp at 4982b91e for special JS Error branches;
- WebKit
DOMException.cpp description 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
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=Debug passes 89/89 symbols.
- Home audit: 91/431 implemented, 340 pending. Bun core audit: 84/421 implemented, 337 pending.
Parent
Scope
Implement
ZigString__toDOMExceptionInstanceagainst the complete pinned u8WebCore::ExceptionCodecontract, not only AbortError/TimeoutError.Evidence sources:
DOMExceptionCodeenum ordering (0-40);JSDOMExceptionHandling.cppat4982b91efor special JS Error branches;DOMException.cppdescription table for DOM names, default messages, and legacy codes.Required behavior:
Acceptance
Completion evidence
Implemented on
mainina37d2f0b; README and ABI documentation published inf8ef4b7c.zig build test-home-private-abi -Doptimize=Debugpasses 89/89 symbols.