Skip to content

feat(wintertc): implement structured clone for DataView - #5531

Open
MayankSharma-2812 wants to merge 1 commit into
boa-dev:mainfrom
MayankSharma-2812:fix/structured-clone-dataview
Open

MayankSharma-2812 wants to merge 1 commit into
boa-dev:mainfrom
MayankSharma-2812:fix/structured-clone-dataview

Conversation

@MayankSharma-2812

Copy link
Copy Markdown

Closes #5530

Summary

Implements structured cloning serialization for DataView instances in boa_wintertc.

Previously, attempting to clone a DataView threw TypeError: Data views are not supported yet. even though deserialization (try_into_data_view) and storage (ValueStoreInner::DataView) were already implemented.

Changes

  • Implemented clone_data_view in core/wintertc/src/store/from.rs to extract and serialize byte_offset, byte_length, and the underlying ArrayBuffer.
  • Removed #[expect(unused)] from ValueStoreInner::DataView in core/wintertc/src/store/mod.rs.
  • Added comprehensive unit tests in core/wintertc/src/clone/tests.rs verifying:
    • DataView byte offset and length preservation.
    • Value isolation between original and cloned buffers.
    • Object identity preservation for multiple DataViews sharing the same ArrayBuffer.

Verification

  • cargo test -p boa_wintertc (56/56 passed)
  • cargo clippy -p boa_wintertc -- -D warnings (0 warnings)
  • cargo fmt -- --check (clean)

@MayankSharma-2812
MayankSharma-2812 requested a review from a team as a code owner September 16, 2026 09:13
@github-actions github-actions Bot added the Waiting On Review Waiting on reviews from the maintainers label Sep 16, 2026
@github-actions github-actions Bot added this to the v0.23 milestone Sep 16, 2026
@github-actions github-actions Bot added the C-Tests Issues and PRs related to the tests. label Sep 16, 2026
@github-actions

Copy link
Copy Markdown

Test262 conformance changes

Test result main count PR count difference
Total 53,578 53,578 0
Passed 51,432 51,432 0
Ignored 1,648 1,648 0
Failed 498 498 0
Panics 0 0 0
Conformance 95.99% 95.99% 0.00%

Tested main commit: 69388e59f789ed0846a8d6aad1e4dc0c91b35816
Tested PR commit: edce572bf0570e29f4294d25a23488cfa0e9f7d0
Compare commits: 69388e5...edce572

@codecov

codecov Bot commented Sep 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 62.98%. Comparing base (6ddc2b4) to head (edce572).
⚠️ Report is 1054 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff             @@
##             main    #5531       +/-   ##
===========================================
+ Coverage   47.24%   62.98%   +15.74%     
===========================================
  Files         476      536       +60     
  Lines       46892    60297    +13405     
===========================================
+ Hits        22154    37980    +15826     
+ Misses      24738    22317     -2421     

☔ View full report in Codecov by Harness.
📢 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-Tests Issues and PRs related to the tests. Waiting On Review Waiting on reviews from the maintainers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

structuredClone() rejects DataView objects with TypeError

1 participant