summaryrefslogtreecommitdiff
path: root/test/parallel/test-timers-unref-throw-then-ref.js
blob: d3ae27e83551c7c534f9a6bfda380894346a7408 (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 assert = require('assert');

process.once('uncaughtException', common.expectsError({
  message: 'Timeout Error'
}));

let called = false;
const t = setTimeout(() => {
  assert(!called);
  called = true;
  t.ref();
  throw new Error('Timeout Error');
}, 1).unref();

setTimeout(common.mustCall(), 1);