diff --git a/packages/core-js/internals/to-length.js b/packages/core-js/internals/to-length.js index 5cf8615a5f7d..3166ef54153c 100644 --- a/packages/core-js/internals/to-length.js +++ b/packages/core-js/internals/to-length.js @@ -6,5 +6,6 @@ var min = Math.min; // `ToLength` abstract operation // https://tc39.es/ecma262/#sec-tolength module.exports = function (argument) { - return argument > 0 ? min(toIntegerOrInfinity(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991 + var len = toIntegerOrInfinity(argument); + return len > 0 ? min(len, 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991 };