Espruino/tests/test_uncaughtException.js
2016-05-23 16:49:41 +01:00

8 lines
207 B
JavaScript

process.on("uncaughtException", function(x) {
print("We got an expected uncaughtException: ",x);
result = x == "Whoa!";
});
setTimeout(function() { throw "Whoa!"; }, 1);
setTimeout(function() {}, 50);