-
Notifications
You must be signed in to change notification settings - Fork 25.3k
structuredClone loses own __proto__ data properties #58216
Copy link
Copy link
Open
Labels
Needs: Author FeedbackNeeds: ReproThis issue could be improved with a clear list of steps to reproduce the issue.This 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.There has been a lack of activity on this issue and it may be closed soon.
Description
Activity
Metadata
Metadata
Assignees
Labels
Needs: Author FeedbackNeeds: ReproThis issue could be improved with a clear list of steps to reproduce the issue.This 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.There has been a lack of activity on this issue and it may be closed soon.
Description
The React Native
structuredClonepolyfill 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. NativestructuredClonefollows this behavior.React Native Version
0.87.1 and current main
Affected Platforms
JavaScript runtime - All