Closed GoogleCodeExporter closed 9 years ago
I think there is no way to "graceful exit" a JavaScript program other than its
proper
end.
However, I will try to implement an Exit(<code>) function that will throw an
Exit
exception.
If the Exit exception is not caught, the program will use the <code> as exit
code.
Original comment by sou...@gmail.com
on 14 Nov 2008 at 6:27
Finally, I will simply use the valueOf any uncatched exception as exit code.
eg.
throw 2
Original comment by sou...@gmail.com
on 16 Nov 2008 at 8:19
fixed at revision r2157.
Original comment by sou...@gmail.com
on 16 Nov 2008 at 8:40
Whohoo...
Ok, so did you create Exit, or just change exception handling?
Just so I know if I should tweak my Exit function or remove it.
Original comment by nadir.se...@gmail.com
on 16 Nov 2008 at 10:10
Just change the exception handling. You can change your Exit() function like
this:
function Exit(exitCode) {
throw exitCode;
}
Perhaps I will remove the Halt() function.
Original comment by sou...@gmail.com
on 16 Nov 2008 at 10:22
Original issue reported on code.google.com by
nadir.se...@gmail.com
on 11 Nov 2008 at 10:57