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

[bug] IE11 needs Object.keys for ES6 behavior #472

Closed
agriffis opened this issue Feb 19, 2020 · 6 comments
Closed

[bug] IE11 needs Object.keys for ES6 behavior #472

agriffis opened this issue Feb 19, 2020 · 6 comments

Comments

@agriffis
Copy link

What

polyfill.io doesn't return polyfill Object.keys on IE11 by default, because it has an implementation. But the native implementation is the ES5 variant which breaks various libs, for example see reduxjs/redux-toolkit#152

Details

The Object.keys polyfill supports ES6 behavior:

polyfillpolyfill/polyfill-service#991
polyfillpolyfill/polyfill-service#1033

but it's not included in the bundle for IE11

The script tag I'm using is

<script src="https://polyfill.io/v3/polyfill.js?features=default,es5,es6,es7,es2017,console.debug,console.log,console.warn,fetch,HTMLPictureElement,Symbol|Gated"></script>
@agriffis
Copy link
Author

Actually the problem might be that polyfill.io isn't returning the Object.keys polyfill for IE11

@agriffis agriffis changed the title [bug] Object.keys is still ES5 variant [bug] IE11 needs Object.keys for ES6 behavior Feb 19, 2020
@JakeChampion JakeChampion transferred this issue from polyfillpolyfill/polyfill-service Feb 19, 2020
@agriffis
Copy link
Author

Here's a bit more...

https://polyfill.io/v3/polyfill.js?features=Object.keys&ua=Mozilla%2F5.0+%28compatible%3B+MSIE+10.0%3B+Windows+NT+6.1%3B+WOW64%3B+Trident%2F6.0%29 sends the polyfill. That's using the IE 10 user-agent: Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0)

https://polyfill.io/v3/polyfill.js?features=Object.keys&ua=Mozilla%2F5.0+%28Windows+NT+10.0%3B+WOW64%3B+Trident%2F7.0%3B+rv%3A11.0%29+like+Gecko does not send the polyfill. That's using the IE 11 user-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko

which is weird because the config shows it should apply to all IE versions:

https://github.com/Financial-Times/polyfill-library/blob/master/polyfills/Object/keys/config.toml#L18

@agriffis
Copy link
Author

Well sheesh, this has already been fixed in 1b237fb

It's just not serving from polyfill.io yet

@JakeChampion
Copy link
Owner

this is now live :-)

Origami ✨ automation moved this from incoming to complete Feb 24, 2020
@agriffis
Copy link
Author

Thanks Jake!

Unfortunately, though, fixing this just reveals that the polyfill for Object.getOwnPropertyNames isn't ES6 compliant either. I'll file a separate issue.

@agriffis
Copy link
Author

Looks like there's already an issue #218

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 23, 2020
@robertboulton robertboulton removed this from Done in Origami ✨ Jul 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants