-
Notifications
You must be signed in to change notification settings - Fork 137
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
[feature-request] Object.keys
should coerce primitive values in IE11
#294
Comments
neenhouse
added a commit
to neenhouse/polyfill-library
that referenced
this issue
Aug 17, 2019
neenhouse
changed the title
[feature-request]
[feature-request] Aug 17, 2019
Object.keys
should coerce non-object values in IE11Object.keys
should coerce primitive values in IE11
JakeChampion
pushed a commit
to neenhouse/polyfill-library
that referenced
this issue
Aug 20, 2019
JakeChampion
pushed a commit
to neenhouse/polyfill-library
that referenced
this issue
Sep 27, 2019
JakeChampion
pushed a commit
to neenhouse/polyfill-library
that referenced
this issue
Feb 7, 2020
JakeChampion
pushed a commit
to neenhouse/polyfill-library
that referenced
this issue
Feb 7, 2020
JakeChampion
pushed a commit
to neenhouse/polyfill-library
that referenced
this issue
Feb 7, 2020
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Overview
In IE11, running the following causes a uncontrolled exception to occur:
This is problematic for applications written with modern JS, babel is typically used to allow statements like:
Babel will transpile that line and implement a function called
_objectSpread
: https://github.com/babel/babel/blob/a112be2fa0b2abab7fd9a845b3a76b273c506449/packages/babel-helpers/src/helpers.js#L393, which implementsObject.keys
:This is a highly traveled path in UI apps that implement object spread syntax (which is pretty common these days). Spreading non object type data is a pretty easy mistake to make, and modern browsers forgive.
To prevent exception in IE11 with string and number, we should use the polyfill provided from this lib which already follows the ECMA-262 ed 6 spec (http://ecma-international.org/ecma-262/6.0/index.html#sec-object.keys).
Why does this matter
Companies who are trying to optimize their polyfill payload can very likely run into this issue when they try to swap out core-js
Object
APIs for polyfill-library with apps that implement object spread. This issue can cause complete failure in apps and prevent adoption of polyfill-library.Browsers impacted
I should be able to prepare a PR pretty soon to address this issue.
The text was updated successfully, but these errors were encountered: