Closed GoogleCodeExporter closed 8 years ago
Original comment by ondrej.zara
on 11 Feb 2012 at 1:05
Philosophical question: the exit() function accepts no arguments; what status
code should be returned if exit() accepted a code and was called as "exit(0)"?
Exiting the code flow via the means of JS exit() function seems like a
non-standard way of terminating the execution; should v8cgi itself return 0 or
a non-zero code?
Original comment by ondrej.zara
on 11 Feb 2012 at 1:18
IMHO, exit() *should* accept an argument (exitCode - an integer value), and if
provided that exit code should be returned by v8cgi. If the input argument is
omitted (e.g., already existing v8cgi code), then a non-zero could should be
returned (for backward compatibility, since v8cgi 0.9.2 does that.) Though in
general it seems 0 is default value used by most languages (e.g. - Python:
http://docs.python.org/library/sys.html#sys.exit)
It's seems plausible that a programmer will most likely use exit() for abnormal
termination, but it is also likely that exit() is used for successful
termination (e.g., exiting successfully from some deeply nested loop in a
deeply nested function call).
Original comment by anuragbi...@gmail.com
on 11 Feb 2012 at 11:01
Okay; exit will accept an argument, its default value will be 1.
Original comment by ondrej.zara
on 12 Feb 2012 at 8:30
Fixed in revision 1004.
Original comment by ondrej.zara
on 12 Feb 2012 at 1:23
Original issue reported on code.google.com by
anuragbi...@gmail.com
on 11 Feb 2012 at 1:23Attachments: