BVB Source Codes

reactide Show es6.array.iterator.js Source code

Return Download reactide: download es6.array.iterator.js Source code - Download reactide Source code - Type:.js
  1. 'use strict';
  2. var addToUnscopables = require('./_add-to-unscopables')
  3.   , step             = require('./_iter-step')
  4.   , Iterators        = require('./_iterators')
  5.   , toIObject        = require('./_to-iobject');
  6.  
  7. // 22.1.3.4 Array.prototype.entries()
  8. // 22.1.3.13 Array.prototype.keys()
  9. // 22.1.3.29 Array.prototype.values()
  10. // 22.1.3.30 Array.prototype[@@iterator]()
  11. module.exports = require('./_iter-define')(Array, 'Array', function(iterated, kind){
  12.   this._t = toIObject(iterated); // target
  13.   this._i = 0;                   // next index
  14.   this._k = kind;                // kind
  15. // 22.1.5.2.1 %ArrayIteratorPrototype%.next()
  16. }, function(){
  17.   var O     = this._t
  18.     , kind  = this._k
  19.     , index = this._i++;
  20.   if(!O || index >= O.length){
  21.     this._t = undefined;
  22.     return step(1);
  23.   }
  24.   if(kind == 'keys'  )return step(0, index);
  25.   if(kind == 'values')return step(0, O[index]);
  26.   return step(0, [index, O[index]]);
  27. }, 'values');
  28.  
  29. // argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7)
  30. Iterators.Arguments = Iterators.Array;
  31.  
  32. addToUnscopables('keys');
  33. addToUnscopables('values');
  34. addToUnscopables('entries');
downloades6.array.iterator.js Source code - Download reactide Source code
Related Source Codes/Software:
rkt - rkt is a pod-native container engine for Linux. It... 2017-06-11
uWebSockets - Tiny WebSockets https://for... 2017-06-11
realworld - TodoMVC for the RealWorld - Exemplary fullstack Me... 2017-06-11
goreplay - GoReplay is an open-source tool for capturing and ... 2017-06-10
pyenv - Simple Python version management 2017-06-10
postal - 2017-06-11
CRYENGINE - CRYENGINE is a powerful real-time game development... 2017-06-11
reactide - Reactide is the first dedicated IDE for React web ... 2017-06-11
redux-saga - An alternative side effect model for Redux apps ... 2017-06-10
angular-starter - 2017-06-10

 Back to top