Skip to content

ABI: implement private ToNumber coercion #183

Description

@chrisbbreuer

Parents: #163, #164
Depends on: #180

Implement the shared private full-ECMAScript ToNumber boundary.

Acceptance:

  • Export the exact Bun__JSValue__toNumber signature.
  • Preserve exact primitive conversion for undefined, null, booleans, int32/double values, and numeric/non-numeric strings.
  • Run ordinary object ToPrimitive with number hint, including Symbol.toPrimitive, valueOf, and toString ordering.
  • Throw TypeError for Symbol and BigInt inputs or primitive results.
  • Return NaN and publish conversion throws through ABI: implement private VM pending exceptions #180 VM pending exceptions, while ordinary numeric NaN leaves no exception pending.
  • Preserve same-VM sibling values and reject foreign-VM or invalid values safely.
  • Preserve an already pending first exception rather than replacing it.
  • Cover exact signatures, primitive matrices, coercion order, thrown hooks, Symbol/BigInt, sibling/foreign ownership, and NaN/exception distinction in the compile-link-runtime fixture.
  • Update both inventories and README/API documentation without changing public/extension counts.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions