ReviewOS

zig-utils/zig-js

ABI: implement ZigString and BunString error factories

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

Parent

Scope

Implement five shared pinned private error factories:

  • JSC__JSValue__createTypeError and JSC__JSValue__createRangeError from ZigString message/code pairs.
  • JSC__createError, JSC__createTypeError, and JSC__createRangeError from every BunString representation.

Match selected-realm intrinsic prototypes, exact message/code text, freshness, first-exception behavior, and the pinned descriptor distinction: RangeError code is read-only while TypeError code is writable.

Acceptance

  • Empty, Latin-1, UTF-8, UTF-16, astral, and lone-surrogate message/code inputs are covered.
  • TypeError and RangeError code descriptors match pinned attributes, including omission for an empty code.
  • BunString Empty, WTFStringImpl, ZigString, StaticZigString, and invalid/dead behavior is explicit.
  • Selected-realm freshness, same-VM siblings, and first-exception preservation are covered.
  • Focused runtime, both inventories, README/docs, and parent trackers are current.

Completion evidence

Implemented on main in 9a34a555; README and ABI documentation published in 8bc87bcf.

  • ZigString message/code pairs cover empty, Latin-1, UTF-8, UTF-16, astral, and lone-surrogate text.
  • TypeError code is writable/enumerable/configurable; RangeError code is read-only/enumerable/configurable; empty codes are omitted.
  • BunString Empty, WTFStringImpl, ZigString, StaticZigString, UTF-8, and dead input dispositions are covered.
  • Fresh selected-realm instances, sibling realms, dead-input failure, and first-exception preservation are exercised.
  • zig build test-home-private-abi -Doptimize=Debug passes 100/100 symbols.
  • Home audit: 102/431 implemented, 329 pending. Bun core audit: 95/421 implemented, 326 pending.
9 days ago

Completed on main in 9a34a55 with documentation in 8bc87bc. Focused runtime: 100/100; Home: 102/431; Bun core: 95/421.

Sign in to comment on this issue.