Describe the bug
If boa reports an uncaught runtime exception in a script, it exits with a zero status code.
To Reproduce
$ echo '1/x;' > /tmp/ref.js && ./boa /tmp/ref.js; echo $?
Uncaught: ReferenceError: x is not defined (native at core/engine/src/vm/opcode/get/name.rs:91:28)
at <main> (/tmp/ref.js:?:?)
0
$ echo 'throw new Error("boom");' > /tmp/throw.js && ./boa /tmp/throw.js; echo $?
Uncaught: Error: boom (/tmp/throw.js:1:7)
at <main> (/tmp/throw.js:1:7)
0
Syntax error for comparison return non-zero code already:
$ echo 'function bad( {}' > /tmp/syntax.js && ./boa /tmp/syntax.js; echo $?
Error:
0: SyntaxError: abrupt end
1
Expected behavior
It should signal an abnormal script termination with a non-zero status code.
Build environment
- OS: Linux
- Version: 0919e3b
- Target triple: aarch64-unknown-linux-gnu
Describe the bug
If boa reports an uncaught runtime exception in a script, it exits with a zero status code.
To Reproduce
Expected behavior
It should signal an abnormal script termination with a non-zero status code.
Build environment