mirror of
https://github.com/nodejs/node.git
synced 2025-05-09 05:17:09 +00:00

Change var to const/let. Simplify test-timers-uncaught-exception. PR-URL: https://github.com/nodejs/node/pull/10524 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
19 lines
459 B
JavaScript
19 lines
459 B
JavaScript
'use strict';
|
|
const common = require('../common');
|
|
const assert = require('assert');
|
|
const errorMsg = 'BAM!';
|
|
|
|
// the first timer throws...
|
|
setTimeout(common.mustCall(function() {
|
|
throw new Error(errorMsg);
|
|
}), 1);
|
|
|
|
// ...but the second one should still run
|
|
setTimeout(common.mustCall(function() {}), 1);
|
|
|
|
function uncaughtException(err) {
|
|
assert.strictEqual(err.message, errorMsg);
|
|
}
|
|
|
|
process.on('uncaughtException', common.mustCall(uncaughtException));
|