mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 11:38:11 +00:00
js: Don't pass error strings as the format argument to outln()
This fixes a crash when the error contains '{}', or an invalid format string.
This commit is contained in:
parent
e43b478920
commit
4387ad9fc6
1 changed files with 1 additions and 1 deletions
|
@ -1187,7 +1187,7 @@ static bool parse_and_run(JS::Interpreter& interpreter, StringView source, Strin
|
|||
auto hint = error.source_location_hint(source);
|
||||
if (!hint.is_empty())
|
||||
outln("{}", hint);
|
||||
outln(error.to_string());
|
||||
outln("{}", error.to_string());
|
||||
result = interpreter.vm().throw_completion<JS::SyntaxError>(interpreter.global_object(), error.to_string());
|
||||
} else {
|
||||
auto return_early = run_script_or_module(script_or_error.value());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue