main
Last change
on this file was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago |
Update repo after prototype presentation
|
-
Property mode
set to
100644
|
File size:
362 bytes
|
Rev | Line | |
---|
[d565449] | 1 | 'use strict';
|
---|
| 2 |
|
---|
| 3 | var MAX_SAFE_INTEGER = require('../helpers/maxSafeInteger');
|
---|
| 4 |
|
---|
| 5 | var ToIntegerOrInfinity = require('./ToIntegerOrInfinity');
|
---|
| 6 |
|
---|
| 7 | module.exports = function ToLength(argument) {
|
---|
| 8 | var len = ToIntegerOrInfinity(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.