es-iterator-helpers
Version:
An ESnext spec-compliant iterator helpers shim/polyfill/replacement that works as far down as ES3.
19 lines (13 loc) • 415 B
JavaScript
;
var define = require('define-properties');
var getPolyfill = require('./polyfill');
var $IteratorPrototype = require('../Iterator.prototype/implementation');
module.exports = function shimIteratorPrototypeTake() {
var polyfill = getPolyfill();
define(
$IteratorPrototype,
{ take: polyfill },
{ take: function () { return $IteratorPrototype.take !== polyfill; } }
);
return polyfill;
};