initial commit. phase 1 complete

This commit is contained in:
2026-05-05 20:45:19 +02:00
parent d9c68313a0
commit 89e058ffac
20631 changed files with 3224610 additions and 43 deletions
+14
View File
@@ -0,0 +1,14 @@
'use strict';
var MAX_SAFE_INTEGER = require('math-intrinsics/constants/maxSafeInteger');
var ToIntegerOrInfinity = require('./ToIntegerOrInfinity');
// https://262.ecma-international.org/12.0/#sec-tolength
module.exports = function ToLength(argument) {
var len = ToIntegerOrInfinity(argument);
if (len <= 0) { return 0; } // includes converting -0 to +0
if (len > MAX_SAFE_INTEGER) { return MAX_SAFE_INTEGER; }
return len;
};