shim.js 355 B

123456789101112131415161718
  1. 'use strict';
  2. var define = require('define-properties');
  3. var globalThis = require('globalthis')();
  4. var getPolyfill = require('./polyfill');
  5. module.exports = function shimIterator() {
  6. var polyfill = getPolyfill();
  7. define(
  8. globalThis,
  9. { Iterator: polyfill },
  10. { Iterator: function () { return Iterator !== polyfill; } }
  11. );
  12. return polyfill;
  13. };