feat(wintertc): migrate queueMicrotask from boa_runtime#5419
Draft
KaustubhOG wants to merge 1 commit into
Draft
Conversation
Test262 conformance changes
Tested main commit: |
Contributor
Author
|
Hey @jedel1043 . The tests use the shared harness and on Will rebase and mark ready once #5418 lands |
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 tracked in #4988, building on the skeleton crate from #5105.
Moves the
microtaskmodule (queueMicrotask) fromboa_runtimeintoboa_wintertc.globalThis.queueMicrotask()is required by the TC55 Minimum Common Web API (section 5.2).Changes:
Moves
mod.rsandtests.rsintoboa_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.logoutput, butconsoleis not migrated intoboa_wintertcyet, so the console-based pieces can't be used here:use crate::RuntimeExtension;-RuntimeExtensionis aboa_runtimetrait;boa_wintertcregisters via plainregister()functions instead.use crate::console::tests::RecordingLogger;-RecordingLoggerlives in theconsolemodule, which is still a stub here.logger+ConsoleExtension(logger).register(...)setup - this installed a console to recordconsole.logoutput; not available without a migrated console.logger.logassertion with the same ordering check done in JS: each step doesorder.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:
microtask/mod.rsmicrotask/tests.rsmod.rs: +6 vs source is the TC55 doc note; code identical. console-free (like the base64 tests).Approach:
boa_runtimekeeps its module for now - no behaviour change, no new cross-crate dependency. Re-export is a follow-up.Testing:
cargo build/clippy/fmtclean.cargo test -p boa_wintertcpasses once #5418 merges.cargo test -p boa_runtime microtaskstill passes (source untouched). Test262 N/A (Web API).