I'm trying to force a stack overflow with this code:
// Throws stack overflow exception
var count = 0;
try {
(function curse() {
console.log(count++);
curse();
})();
} catch (e) {
console.log('ERROR');
console.log(e.message);
}
However, when I run it, it prints numbers to the screen and then exits gracefully. No exception thrown, I can remove the try-catch and still no exception is output to the console.
Why don't I get an exception message dumped to the console?
Node version is v0.12.2, V8 is 3.28.73.
curse()? It's called and the integers are printed out to the screen as I'd expect. It just finishes and exits though.RangeErrorand then just goes a bit nuts as expected.