• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1'use strict';
2
3var ES2016 = require('./es2016');
4var assign = require('./helpers/assign');
5
6var ES2017 = assign(assign({}, ES2016), {
7	ToIndex: function ToIndex(value) {
8		if (typeof value === 'undefined') {
9			return 0;
10		}
11		var integerIndex = this.ToInteger(value);
12		if (integerIndex < 0) {
13			throw new RangeError('index must be >= 0');
14		}
15		var index = this.ToLength(integerIndex);
16		if (!this.SameValueZero(integerIndex, index)) {
17			throw new RangeError('index must be >= 0 and < 2 ** 53 - 1');
18		}
19		return index;
20	}
21});
22
23delete ES2017.EnumerableOwnNames; // replaced with EnumerableOwnProperties
24
25module.exports = ES2017;
26