Skip to content

feat(wintertc): migrate queueMicrotask from boa_runtime#5419

Draft
KaustubhOG wants to merge 1 commit into
boa-dev:mainfrom
KaustubhOG:feat/wintertc-migrate-microtask
Draft

feat(wintertc): migrate queueMicrotask from boa_runtime#5419
KaustubhOG wants to merge 1 commit into
boa-dev:mainfrom
KaustubhOG:feat/wintertc-migrate-microtask

Conversation

@KaustubhOG

@KaustubhOG KaustubhOG commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Part of the TC55 migration tracked in #4988, building on the skeleton crate from #5105.

Moves the microtask module (queueMicrotask) from boa_runtime into boa_wintertc. globalThis.queueMicrotask() is required by the TC55 Minimum Common Web API (section 5.2).

Changes:

  • Moves mod.rs and tests.rs into boa_wintertc. Implementation is unchanged - only a TC55 status note added to the module docs.

  • Adapts the test. Runtime's test proves microtask ordering by capturing console.log output, but console is not migrated into boa_wintertc yet, so the console-based pieces can't be used here:

    • Dropped use crate::RuntimeExtension; - RuntimeExtension is a boa_runtime trait; boa_wintertc registers via plain register() functions instead.
    • Dropped use crate::console::tests::RecordingLogger; - RecordingLogger lives in the console module, which is still a stub here.
    • Dropped the logger + ConsoleExtension(logger).register(...) setup - this installed a console to record console.log output; not available without a migrated console.
    • Replaced the logger.log assertion with the same ordering check done in JS: each step does order.push(n) into an array, and the array is asserted to equal [1,3,9,2,4,8,5,7,6].

    Net result: identical behaviour tested (synchronous pushes first, then microtasks in FIFO order including re-queued ones), but the test depends only on the shared harness - not on a console migration.

Line counts:

File runtime (source) wintertc before wintertc after
microtask/mod.rs 33 23 (stub) 39
microtask/tests.rs 55 0 52

mod.rs: +6 vs source is the TC55 doc note; code identical. console-free (like the base64 tests).

Approach: boa_runtime keeps its module for now - no behaviour change, no new cross-crate dependency. Re-export is a follow-up.

Testing: cargo build / clippy / fmt clean. cargo test -p boa_wintertc passes once #5418 merges. cargo test -p boa_runtime microtask still passes (source untouched). Test262 N/A (Web API).

@github-actions github-actions Bot added the Waiting On Review Waiting on reviews from the maintainers label Jul 1, 2026
@github-actions github-actions Bot added this to the v1.0.0 milestone Jul 1, 2026
@github-actions github-actions Bot added the C-Tests Issues and PRs related to the tests. label Jul 1, 2026
@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown

Test262 conformance changes

Test result main count PR count difference
Total 53,125 53,125 0
Passed 51,072 51,072 0
Ignored 1,482 1,482 0
Failed 571 571 0
Panics 0 0 0
Conformance 96.14% 96.14% 0.00%

Tested main commit: 8a1e8fe07f626f7a067afc2c9885d5d87de4bb5d
Tested PR commit: 8e9d3f94ac1cbcefe989115266026f5fd3e0a947
Compare commits: 8a1e8fe...8e9d3f9

@KaustubhOG

Copy link
Copy Markdown
Contributor Author

Hey @jedel1043 . The tests use the shared harness and indoc from #5418, so cargo test won't compile until that merges ( Test/MSRV checks are red). Build is clean, and it passes locally when combined with #5418.

on tests.rs: I couldn't copy it as exact since the runtime test checks ordering via console.log, and console isn't migrated yet. So I dropped the console bits and just record order into a JS array, asserting the same [1,3,9,2,4,8,5,7,6]. no console dependency.
do you think this approach is correct

Will rebase and mark ready once #5418 lands

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.

1 participant