Skip to content

Commit

Permalink
fix invocations of Call AO (#65)
Browse files Browse the repository at this point in the history
* fix invocations of Call AO

* also update README
  • Loading branch information
michaelficarra authored Nov 6, 2024
1 parent 201c059 commit 8668664
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ Map.prototype.getOrInsertComputed = function (key, callbackFunction) {
if (this.has(key)) {
return this.get(key);
}
this.set(key, callbackFunction());
this.set(key, callbackFunction(key));
return this.get(key);
};
```
4 changes: 2 additions & 2 deletions spec.emu
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ contributors: Jonas Haukenes, Daniel Minor
1. Set _key_ to CanonicalizeKeyedCollectionKey(_key_).
1. For each Record { [[Key]], [[Value]] } _p_ of _M_.[[MapData]], do
1. If _p_.[[Key]] is not ~empty~ and SameValue(_p_.[[Key]], _key_) is *true*, return _p_.[[Value]].
1. Let _value_ be ? Call(_callbackfn_, _key_).
1. Let _value_ be ? Call(_callbackfn_, *undefined*, « _key_ »).
1. Let _p_ be the Record { [[Key]]: _key_, [[Value]]: _value_ }.
1. Append _p_ to _M_.[[MapData]].
1. Return _value_.
Expand Down Expand Up @@ -74,7 +74,7 @@ contributors: Jonas Haukenes, Daniel Minor
1. If CanBeHeldWeakly(_key_) is *false*, throw a *TypeError* exception.
1. For each Record { [[Key]], [[Value]] } _p_ of _M_.[[WeakMapData]], do
1. If _p_.[[Key]] is not ~empty~ and SameValue(_p_.[[Key]], _key_) is *true*, return _p_.[[Value]].
1. Let _value_ be ? Call(_callbackfn_, _key_).
1. Let _value_ be ? Call(_callbackfn_, *undefined*, « _key_ »).
1. Let _p_ be the Record { [[Key]]: _key_, [[Value]]: _value_ }.
1. Append _p_ to _M_.[[WeakMapData]].
1. Return _value_.
Expand Down

0 comments on commit 8668664

Please sign in to comment.