mirror of https://github.com/lukechilds/node.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
570 B
26 lines
570 B
15 years ago
|
process.mixin(require("./common"));
|
||
|
|
||
|
var MESSAGE = 'catch me if you can';
|
||
|
var caughtException = false;
|
||
|
|
||
|
process.addListener('uncaughtException', function (e) {
|
||
|
puts("uncaught exception! 1");
|
||
|
assertEquals(MESSAGE, e.message);
|
||
|
caughtException = true;
|
||
|
});
|
||
|
|
||
|
process.addListener('uncaughtException', function (e) {
|
||
|
puts("uncaught exception! 2");
|
||
|
assertEquals(MESSAGE, e.message);
|
||
|
caughtException = true;
|
||
|
});
|
||
|
|
||
|
setTimeout(function() {
|
||
|
throw new Error(MESSAGE);
|
||
|
}, 10);
|
||
|
|
||
|
process.addListener("exit", function () {
|
||
|
puts("exit");
|
||
|
assertTrue(caughtException);
|
||
|
});
|