$ cat bar.js
console.log("one");
throw "test exception";
console.log("two");
throw "test exception 2";
console.log("three");
$ phantomjs baz.js
one
test exception
baz.js:2 in global code
^C
I don't think hanging is the right answer.
I filed an issue on github, but was trying to understand if I'm missing something conceptually,
since it is technically a headless BROWSER, maybe exiting isn't the right answer, but I was
trying to write some code with capserjs and my exception handlers were going into infinite loops
and broke it down into this problem with phantomjs.