main
Last change
on this file since 79a0317 was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 3 days ago |
F4 Finalna Verzija
|
-
Property mode
set to
100644
|
File size:
347 bytes
|
Rev | Line | |
---|
[d565449] | 1 | 'use strict';
|
---|
| 2 |
|
---|
[79a0317] | 3 | var MAX_SAFE_INTEGER = require('math-intrinsics/constants/maxSafeInteger');
|
---|
[d565449] | 4 |
|
---|
| 5 | var ToInteger = require('./ToInteger');
|
---|
| 6 |
|
---|
| 7 | module.exports = function ToLength(argument) {
|
---|
| 8 | var len = ToInteger(argument);
|
---|
| 9 | if (len <= 0) { return 0; } // includes converting -0 to +0
|
---|
| 10 | if (len > MAX_SAFE_INTEGER) { return MAX_SAFE_INTEGER; }
|
---|
| 11 | return len;
|
---|
| 12 | };
|
---|
Note:
See
TracBrowser
for help on using the repository browser.