summaryrefslogtreecommitdiff
path: root/test/parallel/test-timers-unref-reuse-no-exposed-list.js
blob: 33b2da2f9e214fca0959f9745fa487e7170e1e49 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
'use strict';

require('../common');
const assert = require('assert');

const timer1 = setTimeout(() => {}, 1).unref();
assert.strictEqual(timer1._handle._list, undefined,
                   'timer1._handle._list should be undefined');

// Check that everything works even if the handle was not re-used.
setTimeout(() => {}, 1);
const timer2 = setTimeout(() => {}, 1).unref();
assert.strictEqual(timer2._handle._list, undefined,
                   'timer2._handle._list should be undefined');