feat(wintertc): migrate console from boa_runtime#5441
Open
KaustubhOG wants to merge 1 commit into
Open
Conversation
Test262 conformance changes
Tested main commit: |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5441 +/- ##
===========================================
+ Coverage 47.24% 62.69% +15.44%
===========================================
Files 476 533 +57
Lines 46892 59085 +12193
===========================================
+ Hits 22154 37041 +14887
+ Misses 24738 22044 -2694 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
KaustubhOG
marked this pull request as ready for review
July 20, 2026 19:53
This Pull Request is part of the TC55 migration tracked in boa-dev#4988, and follows the move + re-export pattern established by the base64 migration (boa-dev#5418). **It changes the following:** - **Moves the `console` module** (`mod.rs`, `table.rs`, and `tests.rs`) into `boa_wintertc`. The implementation is **unchanged**: `table.rs` is byte for byte identical, `tests.rs` differs only in one import path (`Logger`/`NullLogger` now come from the console module rather than the `boa_runtime` crate root), and `mod.rs` only gains a short TC55 status note and a thin `register` wrapper (see below). - **Deletes `core/runtime/src/console/`** and **re-exports the module from `boa_runtime`**: `boa_runtime::console` is now `#[doc(inline)] pub use boa_wintertc::console;`. The crate-root re-export `pub use console::{Console, ConsoleState, DefaultLogger, Logger, NullLogger}` keeps resolving through it, so the public API is unchanged. - **Delegates the extension**: `ConsoleExtension` now calls `boa_wintertc::console::Console::register_with_logger`. It stays in the default extension set, so there is no behaviour change for existing users. - **Adds a `register` entry point** to `boa_wintertc::console` so it plugs into `boa_wintertc::register` like the other modules. It installs `console` with the `DefaultLogger`; `register_with_logger` remains the way to supply a custom logger. - **Moves the `comfy-table` dependency** from `boa_runtime` to `boa_wintertc`, as the moved module was its only user, and adds `boa_gc` and `rustc-hash` to `boa_wintertc` (both already used by the console implementation). - **Allows `needless_raw_string_hashes` in test builds** of `boa_wintertc`, matching `boa_runtime`; the console tests use raw JS strings kept copy-pastable. **Two adjustments in `boa_runtime` where console's tests were shared:** - `microtask/tests.rs` used `console::tests::RecordingLogger`, a `#[cfg(test)]` helper that has now left the crate. It defines its own small `RecordingLogger` locally instead. This is temporary: the helper goes away when `microtask` migrates. - `run_test_actions` (the test harness variant that registers a console) was previously kept alive by the always-compiled console tests. Its only remaining callers are the feature-gated `fetch`, `url`, and `abort` tests, so it is now `#[allow(unused)]` to stay warning-free under `--no-default-features`. **Line counts (before and after, in both locations):** | File | `boa_runtime` (before) | `boa_wintertc` before | `boa_wintertc` after | | --- | --- | --- | --- | | `console/mod.rs` | 1008 (deleted) | 23 (stub) | 1027 | | `console/table.rs` | 214 (deleted) | 0 (did not exist) | 214 | | `console/tests.rs` | 853 (deleted) | 0 (did not exist) | 852 | `mod.rs` gains 19 lines: the TC55 status doc note and the `register` wrapper. `table.rs` is identical; `tests.rs` is one line shorter after merging two imports into one. **Testing:** - `cargo test -p boa_wintertc`: all console unit tests pass (46 total including base64 and the doctest). - `cargo test -p boa_runtime` and `--all-features`: pass, with console now exercised through the re-export. - `cargo clippy -p boa_wintertc` and `-p boa_runtime`, each with `--all-features --all-targets` and `--no-default-features`: clean. - `cargo fmt --all -- --check` and `cargo doc --no-deps`: clean. - Verified `console.log`/`info`/`warn`/`error`, `group` indentation, `console.table`, `count`, and `dir` end to end through `boa_cli`. **Out of scope:** - **WPT** is unchanged: the runner targets `boa_runtime`, which reaches this implementation through the re-export. - **Test262** does not apply, as `console` is a Web API rather than ECMAScript.
KaustubhOG
force-pushed
the
feat/wintertc-migrate-console
branch
from
July 23, 2026 22:30
9ab907e to
422e9c5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of the TC55 migration (#4988), following the move + re-export pattern from #5418.
Changes:
console(mod.rs,table.rs,tests.rs) intoboa_wintertcunchanged — only additions are a TC55 doc note and aregisterentry point wrappingConsole::register_with_logger.core/runtime/src/console/;boa_runtime::consoleis now#[doc(inline)] pub use boa_wintertc::console;andConsoleExtensiondelegates to it. Public API unchanged.comfy-tablefromboa_runtimetoboa_wintertc(console was its only user); addsboa_gc+rustc-hashtoboa_wintertc.boa_runtimetest fixes since console's#[cfg(test)]helpers left the crate:microtask/tests.rsgets a localRecordingLogger(goes away when microtask migrates), andrun_test_actionsis#[allow(unused)](only feature-gated tests use it now).Line counts (before and after, in both locations):
boa_runtime(before)boa_wintertcbeforeboa_wintertcafterconsole/mod.rsconsole/table.rsconsole/tests.rsmod.rsgains 19 lines (doc note +registerwrapper);table.rsis identical;tests.rsis one line shorter after merging two imports.