90493146c343e0dc2a861a4b36baec0b.json 6.4 KB

1
  1. {"ast":null,"code":"'use strict';\n\nvar toIndexedObject = require('../internals/to-indexed-object');\n\nvar addToUnscopables = require('../internals/add-to-unscopables');\n\nvar Iterators = require('../internals/iterators');\n\nvar InternalStateModule = require('../internals/internal-state');\n\nvar defineIterator = require('../internals/define-iterator');\n\nvar ARRAY_ITERATOR = 'Array Iterator';\nvar setInternalState = InternalStateModule.set;\nvar getInternalState = InternalStateModule.getterFor(ARRAY_ITERATOR); // `Array.prototype.entries` method\n// https://tc39.es/ecma262/#sec-array.prototype.entries\n// `Array.prototype.keys` method\n// https://tc39.es/ecma262/#sec-array.prototype.keys\n// `Array.prototype.values` method\n// https://tc39.es/ecma262/#sec-array.prototype.values\n// `Array.prototype[@@iterator]` method\n// https://tc39.es/ecma262/#sec-array.prototype-@@iterator\n// `CreateArrayIterator` internal method\n// https://tc39.es/ecma262/#sec-createarrayiterator\n\nmodule.exports = defineIterator(Array, 'Array', function (iterated, kind) {\n setInternalState(this, {\n type: ARRAY_ITERATOR,\n target: toIndexedObject(iterated),\n // target\n index: 0,\n // next index\n kind: kind // kind\n\n }); // `%ArrayIteratorPrototype%.next` method\n // https://tc39.es/ecma262/#sec-%arrayiteratorprototype%.next\n}, function () {\n var state = getInternalState(this);\n var target = state.target;\n var kind = state.kind;\n var index = state.index++;\n\n if (!target || index >= target.length) {\n state.target = undefined;\n return {\n value: undefined,\n done: true\n };\n }\n\n if (kind == 'keys') return {\n value: index,\n done: false\n };\n if (kind == 'values') return {\n value: target[index],\n done: false\n };\n return {\n value: [index, target[index]],\n done: false\n };\n}, 'values'); // argumentsList[@@iterator] is %ArrayProto_values%\n// https://tc39.es/ecma262/#sec-createunmappedargumentsobject\n// https://tc39.es/ecma262/#sec-createmappedargumentsobject\n\nIterators.Arguments = Iterators.Array; // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables\n\naddToUnscopables('keys');\naddToUnscopables('values');\naddToUnscopables('entries');","map":{"version":3,"sources":["/Users/jane/Documents/Курс Front-end/HW8/myproject/node_modules/core-js-pure/modules/es.array.iterator.js"],"names":["toIndexedObject","require","addToUnscopables","Iterators","InternalStateModule","defineIterator","ARRAY_ITERATOR","setInternalState","set","getInternalState","getterFor","module","exports","Array","iterated","kind","type","target","index","state","length","undefined","value","done","Arguments"],"mappings":"AAAA;;AACA,IAAIA,eAAe,GAAGC,OAAO,CAAC,gCAAD,CAA7B;;AACA,IAAIC,gBAAgB,GAAGD,OAAO,CAAC,iCAAD,CAA9B;;AACA,IAAIE,SAAS,GAAGF,OAAO,CAAC,wBAAD,CAAvB;;AACA,IAAIG,mBAAmB,GAAGH,OAAO,CAAC,6BAAD,CAAjC;;AACA,IAAII,cAAc,GAAGJ,OAAO,CAAC,8BAAD,CAA5B;;AAEA,IAAIK,cAAc,GAAG,gBAArB;AACA,IAAIC,gBAAgB,GAAGH,mBAAmB,CAACI,GAA3C;AACA,IAAIC,gBAAgB,GAAGL,mBAAmB,CAACM,SAApB,CAA8BJ,cAA9B,CAAvB,C,CAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACAK,MAAM,CAACC,OAAP,GAAiBP,cAAc,CAACQ,KAAD,EAAQ,OAAR,EAAiB,UAAUC,QAAV,EAAoBC,IAApB,EAA0B;AACxER,EAAAA,gBAAgB,CAAC,IAAD,EAAO;AACrBS,IAAAA,IAAI,EAAEV,cADe;AAErBW,IAAAA,MAAM,EAAEjB,eAAe,CAACc,QAAD,CAFF;AAEc;AACnCI,IAAAA,KAAK,EAAE,CAHc;AAGc;AACnCH,IAAAA,IAAI,EAAEA,IAJe,CAIc;;AAJd,GAAP,CAAhB,CADwE,CAO1E;AACA;AACC,CAT8B,EAS5B,YAAY;AACb,MAAII,KAAK,GAAGV,gBAAgB,CAAC,IAAD,CAA5B;AACA,MAAIQ,MAAM,GAAGE,KAAK,CAACF,MAAnB;AACA,MAAIF,IAAI,GAAGI,KAAK,CAACJ,IAAjB;AACA,MAAIG,KAAK,GAAGC,KAAK,CAACD,KAAN,EAAZ;;AACA,MAAI,CAACD,MAAD,IAAWC,KAAK,IAAID,MAAM,CAACG,MAA/B,EAAuC;AACrCD,IAAAA,KAAK,CAACF,MAAN,GAAeI,SAAf;AACA,WAAO;AAAEC,MAAAA,KAAK,EAAED,SAAT;AAAoBE,MAAAA,IAAI,EAAE;AAA1B,KAAP;AACD;;AACD,MAAIR,IAAI,IAAI,MAAZ,EAAoB,OAAO;AAAEO,IAAAA,KAAK,EAAEJ,KAAT;AAAgBK,IAAAA,IAAI,EAAE;AAAtB,GAAP;AACpB,MAAIR,IAAI,IAAI,QAAZ,EAAsB,OAAO;AAAEO,IAAAA,KAAK,EAAEL,MAAM,CAACC,KAAD,CAAf;AAAwBK,IAAAA,IAAI,EAAE;AAA9B,GAAP;AACtB,SAAO;AAAED,IAAAA,KAAK,EAAE,CAACJ,KAAD,EAAQD,MAAM,CAACC,KAAD,CAAd,CAAT;AAAiCK,IAAAA,IAAI,EAAE;AAAvC,GAAP;AACD,CArB8B,EAqB5B,QArB4B,CAA/B,C,CAuBA;AACA;AACA;;AACApB,SAAS,CAACqB,SAAV,GAAsBrB,SAAS,CAACU,KAAhC,C,CAEA;;AACAX,gBAAgB,CAAC,MAAD,CAAhB;AACAA,gBAAgB,CAAC,QAAD,CAAhB;AACAA,gBAAgB,CAAC,SAAD,CAAhB","sourcesContent":["'use strict';\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar addToUnscopables = require('../internals/add-to-unscopables');\nvar Iterators = require('../internals/iterators');\nvar InternalStateModule = require('../internals/internal-state');\nvar defineIterator = require('../internals/define-iterator');\n\nvar ARRAY_ITERATOR = 'Array Iterator';\nvar setInternalState = InternalStateModule.set;\nvar getInternalState = InternalStateModule.getterFor(ARRAY_ITERATOR);\n\n// `Array.prototype.entries` method\n// https://tc39.es/ecma262/#sec-array.prototype.entries\n// `Array.prototype.keys` method\n// https://tc39.es/ecma262/#sec-array.prototype.keys\n// `Array.prototype.values` method\n// https://tc39.es/ecma262/#sec-array.prototype.values\n// `Array.prototype[@@iterator]` method\n// https://tc39.es/ecma262/#sec-array.prototype-@@iterator\n// `CreateArrayIterator` internal method\n// https://tc39.es/ecma262/#sec-createarrayiterator\nmodule.exports = defineIterator(Array, 'Array', function (iterated, kind) {\n setInternalState(this, {\n type: ARRAY_ITERATOR,\n target: toIndexedObject(iterated), // target\n index: 0, // next index\n kind: kind // kind\n });\n// `%ArrayIteratorPrototype%.next` method\n// https://tc39.es/ecma262/#sec-%arrayiteratorprototype%.next\n}, function () {\n var state = getInternalState(this);\n var target = state.target;\n var kind = state.kind;\n var index = state.index++;\n if (!target || index >= target.length) {\n state.target = undefined;\n return { value: undefined, done: true };\n }\n if (kind == 'keys') return { value: index, done: false };\n if (kind == 'values') return { value: target[index], done: false };\n return { value: [index, target[index]], done: false };\n}, 'values');\n\n// argumentsList[@@iterator] is %ArrayProto_values%\n// https://tc39.es/ecma262/#sec-createunmappedargumentsobject\n// https://tc39.es/ecma262/#sec-createmappedargumentsobject\nIterators.Arguments = Iterators.Array;\n\n// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables\naddToUnscopables('keys');\naddToUnscopables('values');\naddToUnscopables('entries');\n"]},"metadata":{},"sourceType":"script"}