Skip to content

Commit 16409f2

Browse files
authored
fix(cli): print SyntaxError to help test262.fyi (#926)
1 parent 91e0d36 commit 16409f2

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

nova_cli/src/helper.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -776,18 +776,17 @@ pub fn exit_with_parse_errors(errors: Vec<OxcDiagnostic>, source_path: &str, sou
776776
}))
777777
.unwrap();
778778

779-
eprintln!("Parse errors:");
780-
781779
// SAFETY: This function never returns, so `source`'s lifetime must last for
782780
// the duration of the program.
783781
let source: &'static str = unsafe { std::mem::transmute(source) };
784782
let named_source = miette::NamedSource::new(source_path, source);
785783

784+
eprintln!("SyntaxError:");
785+
786786
for error in errors {
787787
let report = error.with_source_code(named_source.clone());
788-
eprint!("{report:?}");
788+
eprintln!("{report:?}");
789789
}
790-
eprintln!();
791790

792791
std::process::exit(1);
793792
}

tests/test262_runner.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ impl BaseTest262Runner {
338338
}
339339
} else if let Some(negative) = negative {
340340
let expected_stderr_prefix: Cow<str> = match negative.phase {
341-
test_metadata::TestFailurePhase::Parse => "Parse errors:".into(),
341+
test_metadata::TestFailurePhase::Parse => "SyntaxError:".into(),
342342
test_metadata::TestFailurePhase::Runtime => {
343343
format!("Uncaught exception: {}", negative.error_type).into()
344344
}

0 commit comments

Comments
 (0)