node/test/parallel/test-timers-invalid-clear.js
Gürgün Dayıoğlu 2cbf3c38db
timers: check for immediate instance in clearImmediate
PR-URL: https://github.com/nodejs/node/pull/57069
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
2025-05-02 17:04:42 -03:00

13 lines
269 B
JavaScript

'use strict';
const common = require('../common');
// clearImmediate should be a noop if anything other than an Immediate
// is passed to it.
const t = setTimeout(common.mustCall());
clearImmediate(t);
setTimeout(common.mustCall());
setTimeout(common.mustCall());