Skip to content

String spread produces raw NaN-boxed floats instead of characters #16

Description

@proggeramlug

Description

[..."hello"] should produce ["h", "e", "l", "l", "o"] but instead produces an array of raw NaN-boxed float values (the STRING_TAG bits interpreted as f64). chars[0] returns a huge number and typeof chars[0] is "number".

Repro

const chars = [..."hello"];
console.log(chars.join(","));  // Expected: h,e,l,l,o
console.log(typeof chars[0]); // Expected: string, Actual: number

Root cause

The spread operator on a string likely produces NaN-boxed string pointers that are stored in the array as f64, but the array element type isn't tracked as string — so IndexGet returns the raw bits as a number instead of unboxing through the string path.

Confirmed pre-existing (present before v0.5.2 optimizations). Affects test_edge_rest_spread_defaults line 42.

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

    bugConfirmed defect or regressionparityCompatibility gap with Node.js, ECMAScript, or the supported ecosystem

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions