You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

polyfillListIE.js 858B

123456789101112131415161718192021222324252627282930313233
  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 () {
  14. return children(this)
  15. }
  16. })
  17. }
  18. } catch (e) {}
  19. /* IE 11 cannot handle getPrototypeOf(not_obj) */
  20. try {
  21. delete Object.getPrototypeOf('test')
  22. } catch (e) {
  23. var old = Object.getPrototypeOf
  24. Object.getPrototypeOf = function (o) {
  25. if (typeof o !== 'object') o = new Object(o)
  26. return old.call(this, o)
  27. }
  28. }