source: frontend/node_modules/es-abstract/2019/ToLength.js

Last change on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 12 days ago

Fix frontend appearance

  • Property mode set to 100644
File size: 404 bytes
Line 
1'use strict';
2
3var MAX_SAFE_INTEGER = require('math-intrinsics/constants/maxSafeInteger');
4
5var ToInteger = require('./ToInteger');
6
7// https://262.ecma-international.org/6.0/#sec-tolength
8
9module.exports = function ToLength(argument) {
10 var len = ToInteger(argument);
11 if (len <= 0) { return 0; } // includes converting -0 to +0
12 if (len > MAX_SAFE_INTEGER) { return MAX_SAFE_INTEGER; }
13 return len;
14};
Note: See TracBrowser for help on using the repository browser.