1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 13:47:45 +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: "); printf("Uncaught exception: ");
print(interpreter->exception()->value()); print(interpreter->exception()->value());
interpreter->clear_exception(); interpreter->clear_exception();
} else if (print_last_result) { return 1;
printf("%s\n", result.to_string().characters());
} }
if (print_last_result)
print(result);
} }
return 0; return 0;