feat(wintertc): migrate atob/btoa from boa_runtime#5418
Conversation
Test262 conformance changes
Tested main commit: |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5418 +/- ##
===========================================
+ Coverage 47.24% 60.32% +13.07%
===========================================
Files 476 567 +91
Lines 46892 63163 +16271
===========================================
+ Hits 22154 38102 +15948
- Misses 24738 25061 +323 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
jedel1043
left a comment
There was a problem hiding this comment.
Thank you for the contribution!
This seems to be a direct clone from boa_runtime, so to avoid code churn I think we should prioritize migrating boa_runtime to use boa_wintertc's atob/btoa, and we should follow the same for the rest of the PRs. Can you integrate that change into this PR?
Move the base64 module (atob and btoa) into the boa_wintertc crate as the first step of migrating the existing Web APIs into the dedicated TC55 crate. The implementation is moved unchanged; the only difference from the boa_runtime version is a short TC55 status note added to the module documentation. boa_runtime now depends on boa_wintertc and consumes atob/btoa from it rather than keeping a duplicate implementation: core/runtime/src/base64 is removed, boa_runtime::base64 becomes a re-export of boa_wintertc::base64, and Base64Extension delegates to boa_wintertc::base64::register. The public API of boa_runtime is unchanged, and the base64 crate dependency is dropped from boa_runtime since the module was its only user. The test harness (TestAction and run_test_actions_with) is ported into boa_wintertc so the migrated unit tests run unchanged. All six base64 unit tests pass.
b6a01d5 to
aebc641
Compare
|
btw our pipeline is slightly blocked by #5427, so just wait a bit until we merge the PR |
yes |
This Pull Request is part of the TC55 migration tracked in #4988, and builds on the skeleton crate from #5105.
It moves the
base64module (atobandbtoa) fromboa_runtimeinto the dedicatedboa_wintertccrate as the first migration step toward hosting the WinterTC TC55 Minimum Common Web API in its own crate.It changes the following:
base64module (mod.rsandtests.rs) intoboa_wintertc. The implementation is unchanged; the only difference from theboa_runtimeversion is a short TC55 status note added to the module documentation.TestActionandrun_test_actions_with) intoboa_wintertcso the migrated unit tests run unchanged. This harness will be reused by later migrations.core/wintertc/Cargo.toml: thebase64dependency, plusindoc,textwrap, andfutures-liteas dev dependencies.Line counts (before and after, in both locations):
boa_runtime(source)boa_wintertcbeforeboa_wintertcafterbase64/mod.rsbase64/tests.rsThe 4 extra lines in
mod.rsare the TC55 status doc note; the code itself is identical.tests.rsis byte for byte the same.Approach:
boa_runtimekeeps its ownbase64module for now, so there is no behaviour change for existing users and no new cross-crate dependency is introduced in this PR. Wiringboa_runtimeto re-export fromboa_wintertc(and removing the duplicate) is intended as a follow up, once the dependency direction between the two crates is agreed.Testing:
cargo test -p boa_wintertc: all six base64 unit tests pass, plus the crate doctest.cargo clippy -p boa_wintertc --all-features --all-targets: clean, no warnings.cargo fmt -p boa_wintertc -- --check: clean.cargo test -p boa_runtime base64: still passes (source untouched).Out of scope:
boa_runtime, so it does not yet exercise theboa_wintertccopy. That is covered automatically once the re-export follow up lands.atobandbtoaare Web APIs rather than ECMAScript.