Fix: Map/Set polyfill should store -0 in keys as +0#2905
Closed
teppeis wants to merge 1 commit intogoogle:masterfrom
Closed
Fix: Map/Set polyfill should store -0 in keys as +0#2905teppeis wants to merge 1 commit intogoogle:masterfrom
teppeis wants to merge 1 commit intogoogle:masterfrom
Conversation
Contributor
teppeis
commented
Apr 24, 2018
- https://www.ecma-international.org/ecma-262/8.0/#sec-map.prototype.set
- https://www.ecma-international.org/ecma-262/8.0/#sec-set.prototype.add
- https://kangax.github.io/compat-table/es6/#test-Map_-0_key_converts_to_+0
- https://kangax.github.io/compat-table/es6/#test-Set_-0_key_converts_to_+0
Contributor
Contributor
Author
|
@brad4d |
Contributor
|
@teppeis what I'm saying is I suspect our code actually handles |
Contributor
Author
|
@brad4d Current polyfill handles const map = new Map().set(-0, 'foo');
assertEquals(Infinity, 1 / map.keys().next().value);
const set = new Set([-0]);
assertEquals(Infinity, 1 / set.keys().next().value); |
Contributor
|
imported and sent for internal review |
Contributor
|
added a few more test cases |
Contributor
Author
|
@brad4d @lauraharker thanks! |
Yannic
pushed a commit
to Yannic/com_google_closure_compiler
that referenced
this pull request
Jul 16, 2018
Closes google#2905 ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=195437315
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.