polyfillListIE.js 844 B

1234567891011121314151617181920212223242526272829303132
  1. /* global SVGElement */
  2. /* eslint no-new-object: "off" */
  3. import CustomEventPolyfill from '@target/custom-event-polyfill/src/index.js6'
  4. import children from '../src/polyfills/children.js'
  5. /* IE 11 has no innerHTML on SVGElement */
  6. import '../src/polyfills/innerHTML.js'
  7. /* IE 11 has no correct CustomEvent implementation */
  8. CustomEventPolyfill()
  9. /* IE 11 has no children on SVGElement */
  10. try {
  11. if (!SVGElement.prototype.children) {
  12. Object.defineProperty(SVGElement.prototype, 'children', {
  13. get: function () { return children(this) }
  14. })
  15. }
  16. } catch (e) {}
  17. /* IE 11 cannot handle getPrototypeOf(not_obj) */
  18. try {
  19. delete Object.getPrototypeOf('test')
  20. } catch (e) {
  21. var old = Object.getPrototypeOf
  22. Object.getPrototypeOf = function (o) {
  23. if (typeof o !== 'object') o = new Object(o)
  24. return old.call(this, o)
  25. }
  26. }