Closed
Bug 718786
Opened 12 years ago
Closed 12 years ago
JavaScript shell exits with a zero status when program is terminated
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
mozilla12
People
(Reporter: jimb, Unassigned)
Details
Attachments
(1 file)
4.68 KB,
patch
|
jorendorff
:
review+
|
Details | Diff | Splinter Review |
If the JavaScript shell runs a file (via -f) whose code terminates (that is, execution returns an error, but no exception is set), the shell exits with a zero status. It should only exit with a zero status when all files specified by -f and scripts given using -e complete successfully. For example: $ cat foo.js terminate(); $ cat bar.js print("Hi, from bar!"); $ js -f foo.js; echo $? 0 $ js -f bar.js; echo $? Hi, from bar! 0 $ js -f foo.js -f bar.js; echo $? Hi, from bar! 0 $ (Here, 'terminate' is the function defined by the patch in bug 717417.)
Reporter | ||
Updated•12 years ago
|
Flags: in-testsuite+
OS: Linux → All
Hardware: x86_64 → All
Target Milestone: --- → mozilla13
Reporter | ||
Comment 1•12 years ago
|
||
In js/src/jit-test/jit_test.py, add an 'exitstatus' jit-test cookie attribute (and rename test.error to test.expect_error). Mark tests that terminate with their expected termination code. Clean up TMFLAGS comments.
Attachment #591676 -
Flags: review?(jorendorff)
Comment 2•12 years ago
|
||
Comment on attachment 591676 [details] [diff] [review] Make the shell exit with EXITCODE_RUNTIME_ERROR when code is terminated. Thanks! I'd even be OK with a bigger change in behavior here, where a single failing -e or -f causes Process to return false, and its caller checks the return value and bails out. Separate bug if so.
Attachment #591676 -
Flags: review?(jorendorff) → review+
Reporter | ||
Comment 3•12 years ago
|
||
(In reply to Jason Orendorff [:jorendorff] from comment #2) > I'd even be OK with a bigger change in behavior here, where a single failing > -e or -f causes Process to return false, and its caller checks the return > value and bails out. Separate bug if so. Actually, every caller of Process already checks gExitCode, so that is the behavior this patch brings about.
Reporter | ||
Comment 4•12 years ago
|
||
try: https://tbpl.mozilla.org/?tree=Try&rev=6914ca5efbd0
Reporter | ||
Comment 5•12 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/ab3edf81a46f
Status: NEW → ASSIGNED
Comment 6•12 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/ab3edf81a46f
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: mozilla13 → mozilla12
You need to log in
before you can comment on or make changes to this bug.
Description
•