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

Fix error when trying to override a non-configurable "name" property #112

Merged
merged 2 commits into from
Apr 7, 2022

Conversation

MattiasBuelens
Copy link
Owner

In very old browsers, Function.name may be non-configurable (see MDN). When the polyfill tries to re-define this property, the Object.defineProperty call will throw, making the polyfill fail to load.

Fix this by catching and then ignoring this error. This name property is only checked by the web platform tests anyway, regular users shouldn't care too much about it being different. 🤷

@MattiasBuelens MattiasBuelens self-assigned this Apr 7, 2022
@MattiasBuelens MattiasBuelens added this to the v3.2.1 milestone Apr 7, 2022
@MattiasBuelens MattiasBuelens merged commit ed44d09 into master Apr 7, 2022
@MattiasBuelens MattiasBuelens deleted the fix-function-name-non-configurable branch April 7, 2022 20:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant