mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 22:38:13 +00:00
js: Print call stack on exception thrown outside the global context
This commit is contained in:
parent
4f6912c605
commit
6c89303e7e
1 changed files with 5 additions and 0 deletions
|
@ -344,6 +344,11 @@ bool parse_and_run(JS::Interpreter& interpreter, const StringView& source)
|
|||
if (interpreter.exception()) {
|
||||
printf("Uncaught exception: ");
|
||||
print(interpreter.exception()->value());
|
||||
auto trace = interpreter.exception()->trace();
|
||||
if (trace.size() > 1) {
|
||||
for (auto& function_name : trace)
|
||||
printf(" -> %s\n", function_name.characters());
|
||||
}
|
||||
interpreter.clear_exception();
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue