Conversation
Test262 conformance changes
Tested main commit: |
|
Fixed lint errors in lib.rs / test262.rs and rebased. |
Move `$262` implementation from `tests/tester/src/exec/js262.rs` to `core/runtime/src/test262.rs` behind a new `test262` feature gate (pulls `bus` as optional dep). Add `annex-b` feature to boa_runtime forwarding to `boa_engine/annex-b` for `$262.IsHTMLDDA`. Both cli and boa_tester now use `boa_runtime/test262`, removing the tester's direct `bus` and `boa_gc` deps. CLI registers `$262` when `--test262-object` flag is passed. Switched $262.agent.monotonicNow() to context.clock().now().millis_since_epoch(). This change makes CLI more suitable for running test262 via an external harness such as eshost + test262-harness. The exact same `$262` object as used by the internal boa_tester can now be directly accessed in CLI. Existing `$boa` object doesn't expose some of the methods (like IsHTMLDDA, detachArrayBuffer and agent helpers) needed for full test262 support, and would have required users to maintain a custom shim mapping it to `$262`. Fixes boa-dev#5054
test262 tests use print() to signal async completion and errors. The tester has its own print() implementation to catch reported errors, but CLI should just print them, so let's alias it to console.log().
Treat files with .mjs extension as modules without requiring --module flag. Many other JavaScript shells do the same - d8, jsc, graaljs, xs, escargot. A small quality-of-life improvement that among other things simplifies configuration for an external test262 harness. The harness could simply stage module tests into *.mjs and forget about --module flag.
Make boa's cli consistent with the behaviour of other major JavaScript shells (d8, jsc, spidermonkey at least) as well as boa_tester by enabling [[CanBlock]] by default. Add --no-can-block flag to opt out, same as V8 (https://github.com/v8/v8/blob/main/src/d8/d8.cc#L6417). Needed for Atomics tests to pass when using an external test262 harness.
|
Rebased again. |
|
I ran Testing boa cli with my patches and my own test262 harness on the same test262 commit vs boa_tester I'm down to just a handful of diffs: test/staging/sm/strict/ I think would be better fixed upstream in test262 repo: tc39/test262#5008 |
|
Nah the CI diff hasn't changed because actions haven't run haha |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5234 +/- ##
===========================================
+ Coverage 47.24% 59.68% +12.44%
===========================================
Files 476 589 +113
Lines 46892 63479 +16587
===========================================
+ Hits 22154 37889 +15735
- Misses 24738 25590 +852 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This Pull Request fixes/closes #5054
It changes the following:
tests/tester/src/exec/js262.rstocore/runtime/src/test262.rsso it can be reused by both cli and boa_tester--test262-objectflag to CLIprint()to CLI with--test262-object[[CanBlock]]by default in CLI to match boa_tester as well as d8/jsc/sm shells default behavior--no-can-blockflag to CLI to support Atomics CanBlockIsFalse tests (same flag name as d8 has)These changes make it possible to reproduce boa_tester's test262 results using external test262 harnesses with boa cli binary.