2015-05-19 13:00:06 +02:00
|
|
|
'use strict';
|
2016-12-29 11:28:10 +01:00
|
|
|
const common = require('../common');
|
2015-03-27 19:43:25 +01:00
|
|
|
|
2016-12-29 11:28:10 +01:00
|
|
|
// Make sure handle._handle.close(callback) is idempotent by closing a timer
|
|
|
|
// twice. The first function should be called, the second one should not.
|
2015-03-27 19:43:25 +01:00
|
|
|
|
2016-12-29 11:28:10 +01:00
|
|
|
const Timer = process.binding('timer_wrap').Timer;
|
|
|
|
const t = new Timer();
|
2015-03-27 19:43:25 +01:00
|
|
|
|
2016-12-29 11:28:10 +01:00
|
|
|
t.close(common.mustCall(function() {}));
|
2017-02-03 20:54:19 +01:00
|
|
|
t.close(common.mustNotCall());
|