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

Fixes check for -0 in Map.set polyfill #132

Merged
merged 1 commit into from
Feb 19, 2019

Conversation

jonbretman
Copy link
Contributor

If an object with a null prototype is provided as a key to the Map polyfill then a TypeError is raised. I think this is expected:

$ node
> var key = Object.create(null);
undefined
> 1/key;
TypeError: Cannot convert object to primitive value

This code was changed here and I think this is where the bug was introduced as I've tried the previous code (key === -0) and it seems to work fine.

@JakeChampion JakeChampion merged commit 09ff71b into JakeChampion:master Feb 19, 2019
@jonbretman
Copy link
Contributor Author

@JakeChampion thanks for merging 👍 Is there any way to know when this is available on https://polyfill.io/v3/polyfill.js?

@JakeChampion
Copy link
Owner

I've added a test for this --> #133
I can let you know when it goes out

@jonbretman
Copy link
Contributor Author

Thanks!

@JakeChampion
Copy link
Owner

The work to add this to polyfill-service is in this PR --> polyfillpolyfill/polyfill-service#1892

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants