shim.js 337 B

1234567891011121314
  1. 'use strict';
  2. var define = require('define-properties');
  3. var getPolyfill = require('./polyfill');
  4. module.exports = function shimArrayPrototypeReduce() {
  5. var polyfill = getPolyfill();
  6. define(
  7. Array.prototype,
  8. { reduce: polyfill },
  9. { reduce: function () { return Array.prototype.reduce !== polyfill; } }
  10. );
  11. return polyfill;
  12. };