summaryrefslogtreecommitdiff
path: root/test/parallel/test-process-next-tick.js
blob: e67ebae0a2955985058705c4d95f5ff4237025e9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
'use strict';
const common = require('../common');
const N = 2;

function cb() {
  throw new Error();
}

for (let i = 0; i < N; ++i) {
  process.nextTick(common.mustCall(cb));
}

process.on('uncaughtException', common.mustCall(function() {}, N));

process.on('exit', function() {
  process.removeAllListeners('uncaughtException');
});