Skip to content

Commit 6df98c1

Browse files
committed
test: refactor test-handle-wrap-close-abort
* use common.mustCall() to confirm number of uncaught exceptions * var -> const * specify duration of 1ms for setTimeout() and setInterval()
1 parent 6aacef7 commit 6df98c1

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
11
'use strict';
2-
require('../common');
2+
const common = require('../common');
33

4-
process.on('uncaughtException', function() { });
4+
function noop() {}
5+
const uncaughtExceptionHandler = common.mustCall(noop, 2);
6+
7+
process.on('uncaughtException', uncaughtExceptionHandler);
58

69
setTimeout(function() {
710
process.nextTick(function() {
8-
var c = setInterval(function() {
11+
const c = setInterval(function() {
912
clearInterval(c);
1013
throw new Error('setInterval');
11-
});
14+
}, 1);
1215
});
1316
setTimeout(function() {
1417
throw new Error('setTimeout');
15-
});
18+
}, 1);
1619
});

0 commit comments

Comments
 (0)