Skip to content

structuredClone loses ArrayBuffer and typed-array data #58218

Description

@OskarEichler

Description

The React Native structuredClone polyfill treats ArrayBuffer, DataView, and every typed array as arbitrary objects, returning plain objects that lose their internal bytes, view type, offsets, lengths, and shared backing-buffer relationships.

Expected behavior

ArrayBuffers should be copied through the intrinsic operation; DataView and all supported typed-array kinds should be reconstructed with their original offset/length and should share the same cloned backing buffer when cloned together. User-shadowed slice or constructor properties must not be invoked. Transfer support is outside this issue.

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