Skip to content

structuredClone loses own __proto__ data properties #58216

Description

@OskarEichler

Description

The React Native structuredClone polyfill copies enumerable properties with ordinary assignment. For an own __proto__ data property on an object or array, assignment invokes the inherited prototype setter: the clone's prototype is replaced and no own property is created.

Expected behavior

__proto__ should be cloned as an ordinary own enumerable/writable/configurable data property with a deeply cloned value, while the clone keeps its normal Object or Array prototype. 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.StaleThere has been a lack of activity on this issue and it may be closed soon.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions