mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
32 lines
538 B
JavaScript
32 lines
538 B
JavaScript
|
'use strict';
|
||
|
|
||
|
const common = require('../common');
|
||
|
const assert = require('assert');
|
||
|
|
||
|
function timerNotCanceled() {
|
||
|
assert.fail('Timer should be canceled');
|
||
|
}
|
||
|
|
||
|
process.on(
|
||
|
'warning',
|
||
|
common.mustNotCall(() => {
|
||
|
assert.fail('Timer should be canceled');
|
||
|
})
|
||
|
);
|
||
|
|
||
|
{
|
||
|
const timeout = setTimeout(timerNotCanceled, 0);
|
||
|
clearTimeout(timeout);
|
||
|
}
|
||
|
|
||
|
{
|
||
|
const interval = setInterval(timerNotCanceled, 0);
|
||
|
clearInterval(interval);
|
||
|
}
|
||
|
|
||
|
{
|
||
|
const timeout = setTimeout(timerNotCanceled, 0);
|
||
|
timeout.refresh();
|
||
|
clearTimeout(timeout);
|
||
|
}
|