paulmillr / es6-shim

ECMAScript 6 compatibility shims for legacy JS engines
http://paulmillr.com
MIT License
3.11k stars 387 forks source link

Issue when prototype.js is present #441

Open dimaslz opened 7 years ago

dimaslz commented 7 years ago

Hi, I have a problem with es6-shim when is using prototype.js.

Basically the code is a widget that is injecting in the website. I using es6-shim to fix a compatibility with IE11, but we have a client that is using prototype.js 1.7 https://ajax.googleapis.com/ajax/libs/prototype/1.7.0/prototype.js in the site and we have a conflict:

screen shot 2017-04-24 at 10 58 04

To do this widget, we are using https://github.com/KoryNunn/crel to create the html and next minify in only one file.

If I use "es6-shim", the widget works in all browsers, but If I remove the "es6-shim" the the script do not work in IE11, but if we use "es6-shim" and in the site is using prototype.js, the script do not work in any browser.

I test with last version of prototype.js (1.7.3.0) https://ajax.googleapis.com/ajax/libs/prototype/1.7.3.0/prototype.js and there another error: screen shot 2017-04-24 at 11 22 27

But only I need to solve for 1.7!

Can you help me with some tip?, I wish to know some opinion.

Thanks you community!

dimaslz commented 7 years ago

Written this, I take the solution. xd

ljharb commented 7 years ago

@dimaslz what was your solution?

ljharb commented 7 years ago

prototype.js is obsolete, but I still want the es6-shim to work with it.

dimaslz commented 7 years ago

@ljharb Yes, I know that is obsolete, but is a special case.

So the solution, I used babel-polyfill and works properly. With es6-shim I have problem, I don't know way. But don't care, will improve a lot thing soon.

Thanks!

ljharb commented 7 years ago

@dimaslz could you provide me with a jsfiddle that reproduces the problem?