Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions nova_cli/src/helper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -776,18 +776,17 @@ pub fn exit_with_parse_errors(errors: Vec<OxcDiagnostic>, 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);

eprintln!("SyntaxError:");

for error in errors {
let report = error.with_source_code(named_source.clone());
eprint!("{report:?}");
eprintln!("{report:?}");
}
eprintln!();

std::process::exit(1);
}
2 changes: 1 addition & 1 deletion tests/test262_runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ impl BaseTest262Runner {
}
} else if let Some(negative) = negative {
let expected_stderr_prefix: Cow<str> = 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()
}
Expand Down