Skip to content

Clone boxed values from internal data - #58227

Open
OskarEichler wants to merge 1 commit into
react:mainfrom
OskarEichler:codex/fix-structured-clone-boxed-values
Open

Clone boxed values from internal data#58227
OskarEichler wants to merge 1 commit into
react:mainfrom
OskarEichler:codex/fix-structured-clone-boxed-values

Conversation

@OskarEichler

Copy link
Copy Markdown
Contributor

Summary:

The structured-clone polyfill passes wrapper objects back into Number/String/Boolean/Date constructors, invoking user coercion and turning boxed false into true. Capture each built-in valueOf intrinsic, read the internal primitive directly, and construct a distinct wrapper from that value.

Fixes #58226.

Changelog:

[GENERAL] [FIXED] - Clone boxed primitive and Date values without user coercion or Boolean value changes.

Test Plan:

  • Exact Hermes baseline aborted on a shadowed Number coercion hook; boxed false also cloned as true.
  • Final regression shadows Number/String/Date coercion and verifies Number, String, Boolean(false), and Date internal values.
  • Fixed focused Fantom suite: 32/32 passed.
  • Fresh yarn flow-check: 0 errors.
  • Targeted ESLint, Prettier, and git diff --check passed.

No UI change; screenshots are not applicable.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Aug 30, 2026
@facebook-github-tools facebook-github-tools Bot added the Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. label Aug 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

structuredClone coerces boxed primitives and flips false Boolean

1 participant