Description
The React Native structuredClone polyfill reads value.source and value.flags, so own overrides replace a RegExp's internal pattern/flags while cloning. Capturing only the aggregate flags getter is also insufficient because it reads user-visible per-flag properties such as global.
Expected behavior
RegExp cloning should read the built-in internal source and canonical d g i m s u v y flags without invoking or trusting own overrides, matching native structuredClone.
React Native Version
0.87.1 and current main
Affected Platforms
JavaScript runtime - All
Description
The React Native
structuredClonepolyfill readsvalue.sourceandvalue.flags, so own overrides replace a RegExp's internal pattern/flags while cloning. Capturing only the aggregateflagsgetter is also insufficient because it reads user-visible per-flag properties such asglobal.Expected behavior
RegExp cloning should read the built-in internal source and canonical
d g i m s u v yflags without invoking or trusting own overrides, matching nativestructuredClone.React Native Version
0.87.1 and current main
Affected Platforms
JavaScript runtime - All