Skip to content

Commit

Permalink
validate WeakMap key before callbackfn call in `WeakMap.prototype…
Browse files Browse the repository at this point in the history
….getOrInsertComputed`
  • Loading branch information
zloirock committed Oct 28, 2024
1 parent 19a93a7 commit 2b189d3
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ $({ target: 'WeakMap', proto: true, real: true, forced: true }, {
aWeakMap(this);
aCallable(callbackfn);
if (has(this, key)) return get(this, key);
set(this, key); // key validation
var value = callbackfn(key);
set(this, key, value);
return value;
Expand Down

0 comments on commit 2b189d3

Please sign in to comment.