mirror of
https://github.com/nodejs/node.git
synced 2024-12-01 16:10:02 +01:00
7192e913f7
PR-URL: https://github.com/nodejs/node/pull/14616 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Refael Ackermann <refack@gmail.com>
15 lines
404 B
JavaScript
15 lines
404 B
JavaScript
'use strict';
|
|
const common = require('../common');
|
|
|
|
const timeout = setTimeout(common.mustCall(), 10);
|
|
timeout.unref();
|
|
|
|
// Wrap `close` method to check if the handle was closed
|
|
const close = timeout._handle.close;
|
|
timeout._handle.close = common.mustCall(function() {
|
|
return close.apply(this, arguments);
|
|
});
|
|
|
|
// Just to keep process alive and let previous timer's handle die
|
|
setTimeout(() => {}, 50);
|