-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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: Map/Set polyfill should store -0 in keys as +0 #2905
Conversation
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
@brad4d |
@teppeis what I'm saying is I suspect our code actually handles |
@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); |
imported and sent for internal review |
added a few more test cases |
@brad4d @lauraharker thanks! |
Closes google#2905 ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=195437315