|
Last change
on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 12 days ago |
|
Fix frontend appearance
|
-
Property mode
set to
100644
|
|
File size:
673 bytes
|
| Line | |
|---|
| 1 | 'use strict';
|
|---|
| 2 | /* eslint-disable es/no-bigint -- safe */
|
|---|
| 3 | var $ = require('../internals/export');
|
|---|
| 4 | var NumericRangeIterator = require('../internals/numeric-range-iterator');
|
|---|
| 5 |
|
|---|
| 6 | var $TypeError = TypeError;
|
|---|
| 7 |
|
|---|
| 8 | // `Iterator.range` method
|
|---|
| 9 | // https://github.com/tc39/proposal-iterator.range
|
|---|
| 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 | });
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.