1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 11:18:11 +00:00

js: Return 1 after exception in non-REPL mode

This commit is contained in:
Linus Groh 2020-04-03 21:52:49 +01:00 committed by Andreas Kling
parent fb67bc2f4f
commit a769db6078

View file

@ -380,9 +380,10 @@ int main(int argc, char** argv)
printf("Uncaught exception: ");
print(interpreter->exception()->value());
interpreter->clear_exception();
} else if (print_last_result) {
printf("%s\n", result.to_string().characters());
return 1;
}
if (print_last_result)
print(result);
}
return 0;