Show More
Commit Description:
merge
Commit Description:
merge
References:
File last commit:
Show/Diff file:
Action:
node_modules/core-js/modules/_to-index.js
| 10 lines
| 339 B
| application/javascript
| JavascriptLexer
|
r789 | // https://tc39.github.io/ecma262/#sec-toindex | |||
var toInteger = require('./_to-integer'); | ||||
var toLength = require('./_to-length'); | ||||
module.exports = function (it) { | ||||
if (it === undefined) return 0; | ||||
var number = toInteger(it); | ||||
var length = toLength(number); | ||||
if (number !== length) throw RangeError('Wrong length!'); | ||||
return length; | ||||
}; | ||||