Skip to content

Commit

Permalink
normalize key in Map.prototype.getOrInsertComputed
Browse files Browse the repository at this point in the history
  • Loading branch information
zloirock committed Oct 28, 2024
1 parent 2b189d3 commit 4bdfd91
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/core-js/modules/esnext.map.get-or-insert-computed.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ $({ target: 'Map', proto: true, real: true, forced: true }, {
aMap(this);
aCallable(callbackfn);
if (has(this, key)) return get(this, key);
// CanonicalizeKeyedCollectionKey
if (key === 0 && 1 / key === -Infinity) key = 0;
var value = callbackfn(key);
set(this, key, value);
return value;
Expand Down

0 comments on commit 4bdfd91

Please sign in to comment.