Actualizacion maquina principal
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / core-js / internals / iterators-core.js
1 'use strict';
2 var getPrototypeOf = require('../internals/object-get-prototype-of');
3 var createNonEnumerableProperty = require('../internals/create-non-enumerable-property');
4 var has = require('../internals/has');
5 var wellKnownSymbol = require('../internals/well-known-symbol');
6 var IS_PURE = require('../internals/is-pure');
7
8 var ITERATOR = wellKnownSymbol('iterator');
9 var BUGGY_SAFARI_ITERATORS = false;
10
11 var returnThis = function () { return this; };
12
13 // `%IteratorPrototype%` object
14 // https://tc39.github.io/ecma262/#sec-%iteratorprototype%-object
15 var IteratorPrototype, PrototypeOfArrayIteratorPrototype, arrayIterator;
16
17 if ([].keys) {
18   arrayIterator = [].keys();
19   // Safari 8 has buggy iterators w/o `next`
20   if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS = true;
21   else {
22     PrototypeOfArrayIteratorPrototype = getPrototypeOf(getPrototypeOf(arrayIterator));
23     if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype = PrototypeOfArrayIteratorPrototype;
24   }
25 }
26
27 if (IteratorPrototype == undefined) IteratorPrototype = {};
28
29 // 25.1.2.1.1 %IteratorPrototype%[@@iterator]()
30 if (!IS_PURE && !has(IteratorPrototype, ITERATOR)) {
31   createNonEnumerableProperty(IteratorPrototype, ITERATOR, returnThis);
32 }
33
34 module.exports = {
35   IteratorPrototype: IteratorPrototype,
36   BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS
37 };