Description
The React Native structuredClone polyfill interpolates rejected values into its error message. That invokes user-defined coercion such as Symbol.toPrimitive; a non-cloneable function or WeakMap can therefore replace the required DataCloneError with an arbitrary user-thrown error.
Expected behavior
Rejecting an unsupported value should produce DOMException / DataCloneError without executing user coercion hooks. The non-standard message does not need to include the rejected value.
React Native Version
0.87.1 and current main
Affected Platforms
JavaScript runtime - All
Description
The React Native
structuredClonepolyfill interpolates rejected values into its error message. That invokes user-defined coercion such asSymbol.toPrimitive; a non-cloneable function or WeakMap can therefore replace the requiredDataCloneErrorwith an arbitrary user-thrown error.Expected behavior
Rejecting an unsupported value should produce
DOMException/DataCloneErrorwithout executing user coercion hooks. The non-standard message does not need to include the rejected value.React Native Version
0.87.1 and current main
Affected Platforms
JavaScript runtime - All