shim.js 462 B

123456789101112131415161718192021
  1. 'use strict';
  2. var define = require('define-properties');
  3. var getPolyfill = require('./polyfill');
  4. module.exports = function shimGetPrototypeOf() {
  5. define(
  6. global,
  7. { Reflect: {} },
  8. { Reflect: function () { return typeof Reflect !== 'object' || !Reflect; } }
  9. );
  10. var polyfill = getPolyfill();
  11. define(
  12. Reflect,
  13. { getPrototypeOf: polyfill },
  14. { getPrototypeOf: function () { return Reflect.getPrototypeOf !== polyfill; } }
  15. );
  16. return polyfill;
  17. };