0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
nodejs/test/parallel/test-timer-close.js

12 lines
351 B
JavaScript
Raw Normal View History

'use strict';
const common = require('../common');
// Make sure handle._handle.close(callback) is idempotent by closing a timer
// twice. The first function should be called, the second one should not.
const Timer = process.binding('timer_wrap').Timer;
const t = new Timer();
t.close(common.mustCall(function() {}));
t.close(common.mustNotCall());