From 3928aec65d742313de57837ff2428ca7c88d09e7 Mon Sep 17 00:00:00 2001 From: Minseok Choe Date: Wed, 3 Jan 2024 16:06:41 +0900 Subject: [PATCH] fix abstract operation --- packages/core-js/internals/to-length.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 };