Skip to content

Commit d7cd971

Browse files
committed
cli: define print() for test262 compatibility
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().
1 parent ccf7f85 commit d7cd971

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

cli/src/main.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -572,6 +572,12 @@ fn main() -> Result<()> {
572572
true, // register `console` in $262.agent worker threads
573573
context,
574574
);
575+
576+
// Add print() that test262 uses to report errors and async success.
577+
// boa_tester handles it internally, but CLI should just print messages.
578+
context
579+
.eval(Source::from_bytes("var print = console.log.bind(console);"))
580+
.expect("failed to define print");
575581
}
576582

577583
// Configure optimizer options

0 commit comments

Comments
 (0)