Sha256: 3bde2c6edbac408fd51bc953bab124ac9a554e7c02189aebf4db8f90752df0a1

Contents?: true

Size: 1.62 KB

Versions: 17

Compression:

Stored size: 1.62 KB

Contents

'use strict';
// https://github.com/tc39/proposal-iterator-helpers
var $ = require('../internals/export');
var global = require('../internals/global');
var anInstance = require('../internals/an-instance');
var createNonEnumerableProperty = require('../internals/create-non-enumerable-property');
var fails = require('../internals/fails');
var has = require('../internals/has');
var wellKnownSymbol = require('../internals/well-known-symbol');
var IteratorPrototype = require('../internals/iterators-core').IteratorPrototype;
var IS_PURE = require('../internals/is-pure');

var ITERATOR = wellKnownSymbol('iterator');
var TO_STRING_TAG = wellKnownSymbol('toStringTag');

var NativeIterator = global.Iterator;

// FF56- have non-standard global helper `Iterator`
var FORCED = IS_PURE
  || typeof NativeIterator != 'function'
  || NativeIterator.prototype !== IteratorPrototype
  // FF44- non-standard `Iterator` passes previous tests
  || !fails(function () { NativeIterator({}); });

var IteratorConstructor = function Iterator() {
  anInstance(this, IteratorConstructor);
};

if (IS_PURE) {
  IteratorPrototype = {};
  createNonEnumerableProperty(IteratorPrototype, ITERATOR, function () {
    return this;
  });
}

if (!has(IteratorPrototype, TO_STRING_TAG)) {
  createNonEnumerableProperty(IteratorPrototype, TO_STRING_TAG, 'Iterator');
}

if (FORCED || !has(IteratorPrototype, 'constructor') || IteratorPrototype.constructor === Object) {
  createNonEnumerableProperty(IteratorPrototype, 'constructor', IteratorConstructor);
}

IteratorConstructor.prototype = IteratorPrototype;

$({ global: true, forced: FORCED }, {
  Iterator: IteratorConstructor
});

Version data entries

17 entries across 16 versions & 6 rubygems

Version Path
optimacms-0.1.61 spec/dummy/node_modules/core-js/modules/esnext.iterator.constructor.js
tang-0.2.1 spec/tang_app/node_modules/core-js/modules/esnext.iterator.constructor.js
groonga-client-model-6.0.0 test/apps/rails6.1.3/node_modules/core-js/modules/esnext.iterator.constructor.js
groonga-client-model-6.0.0 test/apps/rails6.0.3.5/node_modules/core-js/modules/esnext.iterator.constructor.js
ruby2js-4.0.4 lib/tasks/testrails/node_modules/core-js/modules/esnext.iterator.constructor.js
ruby2js-4.0.3 lib/tasks/testrails/node_modules/core-js/modules/esnext.iterator.constructor.js
tang-0.2.0 spec/tang_app/node_modules/core-js/modules/esnext.iterator.constructor.js
tang-0.1.0 spec/tang_app/node_modules/core-js/modules/esnext.iterator.constructor.js
tang-0.0.9 spec/tang_app/node_modules/core-js/modules/esnext.iterator.constructor.js
enju_library-0.3.8 spec/dummy/node_modules/core-js/modules/esnext.iterator.constructor.js
condenser-0.3 lib/condenser/processors/node_modules/core-js-pure/modules/esnext.iterator.constructor.js
condenser-0.2 lib/condenser/processors/node_modules/core-js-pure/modules/esnext.iterator.constructor.js
condenser-0.1 lib/condenser/processors/node_modules/core-js-pure/modules/esnext.iterator.constructor.js
condenser-0.0.12 lib/condenser/processors/node_modules/core-js-pure/modules/esnext.iterator.constructor.js
condenser-0.0.11 lib/condenser/processors/node_modules/core-js-pure/modules/esnext.iterator.constructor.js
condenser-0.0.10 lib/condenser/processors/node_modules/core-js-pure/modules/esnext.iterator.constructor.js
condenser-0.0.9 lib/condenser/processors/node_modules/core-js-pure/modules/esnext.iterator.constructor.js