Skip to content

Commit

Permalink
fix abstract operation
Browse files Browse the repository at this point in the history
  • Loading branch information
stonechoe committed Jan 3, 2024
1 parent 511873f commit 3928aec
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/core-js/internals/to-length.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
};

0 comments on commit 3928aec

Please sign in to comment.