Skip to content

ABI: implement ZigString and BunString error factories #201

Description

@chrisbbreuer

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions