node/test/parallel/test-timers-timeout-with-non-integer.js
Suguru Motegi e9de435498 timers: fix setTimeout expiration logic
Fix the timer logic to be the same as v10.30.0.

Fixes: https://github.com/nodejs/node/issues/24203

PR-URL: https://github.com/nodejs/node/pull/24214
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2018-12-01 08:20:58 -08:00

16 lines
292 B
JavaScript

'use strict';
const common = require('../common');
/**
* This test is for https://github.com/nodejs/node/issues/24203
*/
let count = 50;
const time = 1.00000000000001;
const exec = common.mustCall(() => {
if (--count === 0) {
return;
}
setTimeout(exec, time);
}, count);
exec();