mirror of https://github.com/lukechilds/node.git
Browse Source
In test-timers, confirm that all input values that should be coerced to 1 ms are not being coerced to a significantly larger value. This eliminates the need for the separate test-regress-GH-897. PR-URL: https://github.com/nodejs/node/pull/10960 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>v7.x
committed by
Italo A. Casas
2 changed files with 15 additions and 27 deletions
@ -1,20 +0,0 @@ |
|||
'use strict'; |
|||
|
|||
// Test for bug where a timer duration greater than 0 ms but less than 1 ms
|
|||
// resulted in the duration being set for 1000 ms. The expected behavior is
|
|||
// that the timeout would be set for 1 ms, and thus fire before timers set
|
|||
// with values greater than 1ms.
|
|||
//
|
|||
// Ref: https://github.com/nodejs/node-v0.x-archive/pull/897
|
|||
|
|||
const common = require('../common'); |
|||
|
|||
let timer; |
|||
|
|||
setTimeout(function() { |
|||
clearTimeout(timer); |
|||
}, 0.1); // 0.1 should be treated the same as 1, not 1000...
|
|||
|
|||
timer = setTimeout(function() { |
|||
common.fail('timers fired out of order'); |
|||
}, 2); // ...so this timer should fire second.
|
Loading…
Reference in new issue