Sha256: ed237cc38fefabe29d38e84ce91f7cd8d3501a402e41bac44787aba5d1e48655

Contents?: true

Size: 1.09 KB

Versions: 66

Compression:

Stored size: 1.09 KB

Contents

'use strict';
var addToUnscopables = require('./_add-to-unscopables');
var step = require('./_iter-step');
var Iterators = require('./_iterators');
var toIObject = require('./_to-iobject');

// 22.1.3.4 Array.prototype.entries()
// 22.1.3.13 Array.prototype.keys()
// 22.1.3.29 Array.prototype.values()
// 22.1.3.30 Array.prototype[@@iterator]()
module.exports = require('./_iter-define')(Array, 'Array', function (iterated, kind) {
  this._t = toIObject(iterated); // target
  this._i = 0;                   // next index
  this._k = kind;                // kind
// 22.1.5.2.1 %ArrayIteratorPrototype%.next()
}, function () {
  var O = this._t;
  var kind = this._k;
  var index = this._i++;
  if (!O || index >= O.length) {
    this._t = undefined;
    return step(1);
  }
  if (kind == 'keys') return step(0, index);
  if (kind == 'values') return step(0, O[index]);
  return step(0, [index, O[index]]);
}, 'values');

// argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7)
Iterators.Arguments = Iterators.Array;

addToUnscopables('keys');
addToUnscopables('values');
addToUnscopables('entries');

Version data entries

66 entries across 30 versions & 8 rubygems

Version Path
cortex-0.1.3 spec/dummy/node_modules/core-js/library/modules/es6.array.iterator.js
cortex-0.1.3 spec/dummy/node_modules/core-js/modules/es6.array.iterator.js
condenser-0.0.4 lib/condenser/processors/node_modules/core-js/modules/es6.array.iterator.js
condenser-0.0.4 lib/condenser/processors/node_modules/core-js/library/modules/es6.array.iterator.js
dragonfly_puppeteer-0.1.0 node_modules/core-js/library/modules/es6.array.iterator.js
dragonfly_puppeteer-0.1.0 node_modules/core-js/modules/es6.array.iterator.js