Skip to content

Implement structuredClone and tests #4366

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from
Draft

Conversation

hansl
Copy link
Contributor

@hansl hansl commented Aug 6, 2025

This API will be necessary when implementing transfer across contexts. For now, it implements the Window.structuredClone() function correctly and passes the tests I took from its documentation.

@hansl hansl requested a review from a team August 6, 2025 04:33
Copy link

codecov bot commented Aug 6, 2025

Codecov Report

❌ Patch coverage is 72.63158% with 26 lines in your changes missing coverage. Please review.
✅ Project coverage is 50.48%. Comparing base (6ddc2b4) to head (d626093).
⚠️ Report is 491 commits behind head on main.

Files with missing lines Patch % Lines
core/engine/src/object/builtins/jstypedarray.rs 30.43% 16 Missing ⚠️
core/runtime/src/clone/mod.rs 86.15% 9 Missing ⚠️
core/macros/src/module.rs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4366      +/-   ##
==========================================
+ Coverage   47.24%   50.48%   +3.23%     
==========================================
  Files         476      508      +32     
  Lines       46892    50903    +4011     
==========================================
+ Hits        22154    25698    +3544     
- Misses      24738    25205     +467     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@hansl hansl marked this pull request as draft August 7, 2025 04:31
@hansl
Copy link
Contributor Author

hansl commented Aug 7, 2025

For postMessage, I need a context-free variant of JsValue (including special objects) which would also be useful for this PR, so I'll refactor this PR to include it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant