Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"e.delete is not a function" thrown when site is translated with Google Translate #438

Closed
jsommr opened this issue Apr 4, 2017 · 8 comments

Comments

@jsommr
Copy link

jsommr commented Apr 4, 2017

Following the translate link next to search results on Google will break js on any site using es6-shim. Examples:

http://translate.google.dk/translate?hl=da&sl=en&u=http://www.hostgator.com/
http://translate.google.dk/translate?hl=da&sl=en&u=http://www.videoadblocker.net/
http://translate.google.dk/translate?hl=da&sl=en&u=http://summit.presidents.eu/summit

This is because Google for some reason replaces "Set" with its own implementation.

Perhaps es6-shim could emit a warning instead of throwing exceptions? I don't think there's a way to get the original Set once it's replaced, except for creating an iframe and using its window object, but I don't know if that's a viable solution.

@ljharb
Copy link
Collaborator

ljharb commented Apr 4, 2017

This seems like a bug with Google Translate itself; one that would break any site using babel-polyfill/core-js as well. Have you filed it to Google?

@ljharb
Copy link
Collaborator

ljharb commented Apr 4, 2017

I think this is something I could special-case detect in es6-shim, though.

https://twitter.com/ljharb/status/849335573114363904 / http://translate.googleusercontent.com/translate_c?depth=2&hl=da&rurl=translate.google.com&sl=en&sp=nmt4&u=http://rawgit.com/es-shims/es6-shim/master/test/index.html&usg=ALkJrhiX_iY0sIXkR1g1IS9nwN_t5dyJ_A illustrates the problem as well.

@jsommr
Copy link
Author

jsommr commented Apr 4, 2017

Haven't filed it to Google. Don't even know where to do that...

@jsommr
Copy link
Author

jsommr commented Apr 4, 2017

core-js seems to work and also turns Set into its original function: http://translate.google.dk/translate?hl=da&sl=en&u=https://rawgit.com/zloirock/core-js/master/tests/tests.html

@ljharb
Copy link
Collaborator

ljharb commented Apr 5, 2017

@nerfpops that core-js test page seems to not actually be loading core-js.

@ljharb
Copy link
Collaborator

ljharb commented Apr 5, 2017

However, oddly, the core-js test page's Google JS code doesn't seem to be shimming Set either. Very strange.

@ljharb ljharb closed this as completed in 058a0ac Apr 7, 2017
@ljharb
Copy link
Collaborator

ljharb commented Apr 7, 2017

@nerfpops the next release of es6-shim will replace the broken Set shim with a compliant one on translated pages; I'm still not sure how the core-js test page was able to get at the native Set; but that can be fixed later.

@jsommr
Copy link
Author

jsommr commented Apr 7, 2017

Awesome! You guys are fast :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants