source: imaps-frontend/node_modules/core-js/internals/to-index.js@ 79a0317

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: 475 bytes
Line 
1'use strict';
2var toIntegerOrInfinity = require('../internals/to-integer-or-infinity');
3var toLength = require('../internals/to-length');
4
5var $RangeError = RangeError;
6
7// `ToIndex` abstract operation
8// https://tc39.es/ecma262/#sec-toindex
9module.exports = function (it) {
10 if (it === undefined) return 0;
11 var number = toIntegerOrInfinity(it);
12 var length = toLength(number);
13 if (number !== length) throw new $RangeError('Wrong length or index');
14 return length;
15};
Note: See TracBrowser for help on using the repository browser.