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
commit a769db6078
Notes: sideshowbarker 2024-07-19 07:57:58 +09:00

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;