Skip to content

ABI: implement exact AggregateError construction and access #202

Description

@chrisbbreuer

Parent

Scope

Implement the three shared pinned AggregateError bridges:

  • JSC__JSGlobalObject__createAggregateError from an encoded error slice and ZigString message.
  • JSC__JSGlobalObject__createAggregateErrorWithArray from an existing exact JSArray, by-value BunString message, and optional cause.
  • JSC__JSValue__getErrorsProperty as a direct own-property read that bypasses mutable prototypes/getters.

Acceptance

  • Slice construction preserves order and exact value identity in a fresh selected-realm errors array.
  • Existing-array construction preserves the exact array object and cause identity.
  • Message decoding covers tagged ZigString and BunString representations, including lone surrogates.
  • errors/message/cause descriptors and immutable AggregateError classification match pinned behavior.
  • Same-VM siblings, foreign values, invalid arrays, failure atomicity, and first-exception preservation are covered.
  • Focused runtime, both inventories, README/docs, and parent trackers are current.

Completion evidence

Implemented on main in 454b9d5e; README and ABI documentation published in ff808cd9.

  • Slice construction preserves order and exact value identity in a fresh selected-realm errors array.
  • Existing-array construction preserves the exact array and optional cause identities.
  • Tagged ZigString and by-value BunString messages cover astral and lone-surrogate text.
  • message/errors/cause descriptors are writable, non-enumerable, and configurable; AggregateError classification uses immutable metadata.
  • Direct errors reads bypass prototypes; siblings, foreign inputs, invalid arrays, failure atomicity, and first exceptions are covered.
  • zig build test-home-private-abi -Doptimize=Debug passes 103/103 symbols.
  • Home audit: 105/431 implemented, 326 pending. Bun core audit: 98/421 implemented, 323 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