lib: fix undefined timeout regression
63644dd1cd6e introduced a regression caused by everyone's favourite JavaScript feature: undefined < 0 === undefined >= 0. Add a case to the existing tests to cover this scenario and then add the check for undefined that makes the test pass. PR-URL: https://github.com/nodejs/node/pull/3331 Reviewed-By: Fedor Indutny <fedor@indutny.com> Reviewed By: Evan Lucas <evanlucas@me.com>
This commit is contained in:
parent
47db2472e5
commit
bde32f8a4d
@ -30,7 +30,7 @@ var lists = {};
|
||||
// with them.
|
||||
exports.active = function(item) {
|
||||
const msecs = item._idleTimeout;
|
||||
if (msecs < 0) return;
|
||||
if (msecs < 0 || msecs === undefined) return;
|
||||
|
||||
item._idleStart = Timer.now();
|
||||
|
||||
|
@ -22,7 +22,8 @@ legitTimers.forEach(function(legit) {
|
||||
|
||||
// active() should not create a timer for these
|
||||
var bogusTimers = [
|
||||
{ _idleTimeout: -1 }
|
||||
{ _idleTimeout: -1 },
|
||||
{ _idleTimeout: undefined },
|
||||
];
|
||||
|
||||
bogusTimers.forEach(function(bogus) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user