2015-05-19 13:00:06 +02:00
|
|
|
'use strict';
|
2015-12-23 16:02:12 -08:00
|
|
|
require('../common');
|
2010-12-04 15:20:34 -08:00
|
|
|
var assert = require('assert');
|
2010-09-07 16:38:43 +02:00
|
|
|
|
2010-12-05 22:15:30 +03:00
|
|
|
process.on('uncaughtException', function(err) {
|
2010-08-30 12:02:01 -07:00
|
|
|
console.log('Caught exception: ' + err);
|
|
|
|
});
|
|
|
|
|
2010-09-07 16:38:43 +02:00
|
|
|
var timeoutFired = false;
|
2010-12-05 22:15:30 +03:00
|
|
|
setTimeout(function() {
|
2010-08-30 12:02:01 -07:00
|
|
|
console.log('This will still run.');
|
2010-09-07 16:38:43 +02:00
|
|
|
timeoutFired = true;
|
2010-08-30 12:02:01 -07:00
|
|
|
}, 500);
|
|
|
|
|
2010-09-07 16:38:43 +02:00
|
|
|
process.on('exit', function() {
|
|
|
|
assert.ok(timeoutFired);
|
|
|
|
});
|
|
|
|
|
2010-08-30 12:02:01 -07:00
|
|
|
// Intentionally cause an exception, but don't catch it.
|
|
|
|
nonexistentFunc();
|
|
|
|
console.log('This will not run.');
|
2010-09-07 16:38:43 +02:00
|
|
|
|