mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-13 11:42:38 +03:00
Userland/JS: Print any exceptions after execution of a JS file
This commit is contained in:
parent
6bf47252dc
commit
3906d2b46a
Notes:
sideshowbarker
2024-07-19 07:59:22 +09:00
Author: https://github.com/DAlperin Commit: https://github.com/SerenityOS/serenity/commit/3906d2b46ab Pull-request: https://github.com/SerenityOS/serenity/pull/1582
@ -335,8 +335,13 @@ int main(int argc, char** argv)
|
||||
|
||||
auto result = interpreter->run(*program);
|
||||
|
||||
if (print_last_result)
|
||||
if (interpreter->exception()) {
|
||||
printf("Uncaught exception: ");
|
||||
print(interpreter->exception()->value());
|
||||
interpreter->clear_exception();
|
||||
} else if (print_last_result) {
|
||||
printf("%s\n", result.to_string().characters());
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user