1 | 'use strict';
|
2 |
|
3 | var $ = require('../internals/export');
|
4 | var NumericRangeIterator = require('../internals/numeric-range-iterator');
|
5 |
|
6 | var $TypeError = TypeError;
|
7 |
|
8 |
|
9 |
|
10 | $({ target: 'Iterator', stat: true, forced: true }, {
|
11 | range: function range(start, end, option) {
|
12 | if (typeof start == 'number') return new NumericRangeIterator(start, end, option, 'number', 0, 1);
|
13 | if (typeof start == 'bigint') return new NumericRangeIterator(start, end, option, 'bigint', BigInt(0), BigInt(1));
|
14 | throw new $TypeError('Incorrect Iterator.range arguments');
|
15 | }
|
16 | });
|