From ad11c3086ba08a9ebba54fdee368cb21e5565fc2 Mon Sep 17 00:00:00 2001 From: Aapo Alasuutari Date: Fri, 2 Jan 2026 20:45:12 +0200 Subject: [PATCH 1/2] fix(cli): print SyntaxError to help test262.fyi --- nova_cli/src/helper.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/nova_cli/src/helper.rs b/nova_cli/src/helper.rs index 3c305ef79..3fc32aaf6 100644 --- a/nova_cli/src/helper.rs +++ b/nova_cli/src/helper.rs @@ -776,18 +776,16 @@ pub fn exit_with_parse_errors(errors: Vec, source_path: &str, sou })) .unwrap(); - eprintln!("Parse errors:"); - // SAFETY: This function never returns, so `source`'s lifetime must last for // the duration of the program. let source: &'static str = unsafe { std::mem::transmute(source) }; let named_source = miette::NamedSource::new(source_path, source); for error in errors { + let message = error.message.clone(); let report = error.with_source_code(named_source.clone()); - eprint!("{report:?}"); + eprintln!("{report:?}\nSyntaxError: {}", message); } - eprintln!(); std::process::exit(1); } From 7b04bfd02ddca82780a712f6e4a19bf31f8e969f Mon Sep 17 00:00:00 2001 From: Aapo Alasuutari Date: Fri, 2 Jan 2026 21:06:29 +0200 Subject: [PATCH 2/2] fix --- nova_cli/src/helper.rs | 5 +++-- tests/test262_runner.rs | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/nova_cli/src/helper.rs b/nova_cli/src/helper.rs index 3fc32aaf6..8b98ef460 100644 --- a/nova_cli/src/helper.rs +++ b/nova_cli/src/helper.rs @@ -781,10 +781,11 @@ pub fn exit_with_parse_errors(errors: Vec, source_path: &str, sou let source: &'static str = unsafe { std::mem::transmute(source) }; let named_source = miette::NamedSource::new(source_path, source); + eprintln!("SyntaxError:"); + for error in errors { - let message = error.message.clone(); let report = error.with_source_code(named_source.clone()); - eprintln!("{report:?}\nSyntaxError: {}", message); + eprintln!("{report:?}"); } std::process::exit(1); diff --git a/tests/test262_runner.rs b/tests/test262_runner.rs index c2478bb54..037b7d19c 100644 --- a/tests/test262_runner.rs +++ b/tests/test262_runner.rs @@ -338,7 +338,7 @@ impl BaseTest262Runner { } } else if let Some(negative) = negative { let expected_stderr_prefix: Cow = match negative.phase { - test_metadata::TestFailurePhase::Parse => "Parse errors:".into(), + test_metadata::TestFailurePhase::Parse => "SyntaxError:".into(), test_metadata::TestFailurePhase::Runtime => { format!("Uncaught exception: {}", negative.error_type).into() }