source: trip-planner-front/node_modules/core-js/modules/esnext.iterator.as-indexed-pairs.js@ 8d391a1

Last change on this file since 8d391a1 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 637 bytes
Line 
1'use strict';
2// https://github.com/tc39/proposal-iterator-helpers
3var $ = require('../internals/export');
4var anObject = require('../internals/an-object');
5var createIteratorProxy = require('../internals/iterator-create-proxy');
6
7var IteratorProxy = createIteratorProxy(function (arg) {
8 var result = anObject(this.next.call(this.iterator, arg));
9 var done = this.done = !!result.done;
10 if (!done) return [this.index++, result.value];
11});
12
13$({ target: 'Iterator', proto: true, real: true }, {
14 asIndexedPairs: function asIndexedPairs() {
15 return new IteratorProxy({
16 iterator: anObject(this),
17 index: 0
18 });
19 }
20});
Note: See TracBrowser for help on using the repository browser.