Skip to content

structuredClone turns boxed BigInt values into plain objects #58210

Description

@OskarEichler

Description

The React Native structuredClone polyfill handles boxed Boolean, Number, and String values but omits boxed BigInt. structuredClone(Object(1n)) therefore returns a plain empty object that is not a BigInt wrapper and has no usable primitive value.

Expected behavior

The clone should be a distinct boxed BigInt whose valueOf() matches the input. Native structuredClone follows this behavior.

React Native Version

0.87.1 and current main

Affected Platforms

JavaScript runtime - All

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

    Needs: Author FeedbackNeeds: ReproThis issue could be improved with a clear list of steps to reproduce the issue.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions