|
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 |
|
|---|
| 3 | var MAX_SAFE_INTEGER = require('math-intrinsics/constants/maxSafeInteger');
|
|---|
| 4 |
|
|---|
| 5 | var ToInteger = require('./ToInteger');
|
|---|
| 6 |
|
|---|
| 7 | // https://262.ecma-international.org/6.0/#sec-tolength
|
|---|
| 8 |
|
|---|
| 9 | module.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.