Description
The React Native structuredClone polyfill traverses Map and Set values with for...of. An own Symbol.iterator override is therefore executed and can change the cloned contents or abort cloning, even though structured cloning should read the built-in collection data from internal slots.
Expected behavior
Map and Set cloning should ignore user iterator overrides and clone their real built-in entries, matching native structuredClone.
React Native Version
0.87.1 and current main
Affected Platforms
JavaScript runtime - All
Description
The React Native
structuredClonepolyfill traverses Map and Set values withfor...of. An ownSymbol.iteratoroverride is therefore executed and can change the cloned contents or abort cloning, even though structured cloning should read the built-in collection data from internal slots.Expected behavior
Map and Set cloning should ignore user iterator overrides and clone their real built-in entries, matching native
structuredClone.React Native Version
0.87.1 and current main
Affected Platforms
JavaScript runtime - All