2015-05-19 13:00:06 +02:00
|
|
|
'use strict';
|
2016-04-17 23:41:59 -07:00
|
|
|
const common = require('../common');
|
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);
|
|
|
|
});
|
|
|
|
|
2016-04-17 23:41:59 -07:00
|
|
|
setTimeout(common.mustCall(function() {
|
2010-08-30 12:02:01 -07:00
|
|
|
console.log('This will still run.');
|
2016-04-17 23:41:59 -07:00
|
|
|
}), 50);
|
2010-09-07 16:38:43 +02:00
|
|
|
|
2010-08-30 12:02:01 -07:00
|
|
|
// Intentionally cause an exception, but don't catch it.
|
2016-04-17 23:41:59 -07:00
|
|
|
nonexistentFunc(); // eslint-disable-line no-undef
|
|
|
|
common.fail('This will not run.');
|