adds-object-element.js |
---
esid: proposal-upsert
description: >
Adds a value with an Object key if key is not already in the map.
info: |
WeakMap.prototype.getOrInsertComputed ( key, callbackfn )
...
8. Let p be the Record { [[Key]]: key, [[Value]]: value }.
9. Append p to M.[[WeakMapData]].
...
features: [WeakMap]
--- |
984 |
adds-symbol-element.js |
---
esid: proposal-upsert
description: >
Adds a value with a Symbol key if key is not already in the map.
info: |
WeakMap.prototype.getOrInsertComputed ( _key_, callbackfn )
...
8. Let p be the Record { [[Key]]: key, [[Value]]: value }.
9. Append p to M.[[WeakMapData]].
...
features: [Symbol, WeakMap, symbols-as-weakmap-keys]
--- |
1329 |
adds-value-different-callbackfn.js |
---
esid: proposal-upsert
description: >
Does not throw if `callbackfn` is callable.
info: |
WeakMap.prototype.getOrInsertComputed ( key , callbackfn )
...
3. If IsCallable(callbackfn) is false, throw a TypeError exception.
...
features: [arrow-function]
--- |
1182 |
callbackfn-throws.js |
---
esid: proposal-upsert
description: >
Map.getOrInsertComputed throws when callbackfn throws,
return if abrubt completion Call(callbackfn, undefined, key)
info: |
WeakMap.prototype.getOrInsertComputed ( key , callbackfn )
...
6. Let value be ? Call(callbackfn, undefined, key).
...
--- |
747 |
does-not-evaluate-callbackfn-if-key-present.js |
---
esid: proposal-upsert
description: >
Does not evaluate the callback function if the key is already in the map.
info: |
WeakMap.prototype.getOrInsertComputed ( key, callbackfn )
...
5. For each Record { [[Key]], [[Value]] } p of M.[[WeakMapData]], do
a. If p.[[Key]] is not empty and SameValue(p.[[Key]], key) is true, return p.[[Value]].
6. Let value be ? Call(callbackfn, undefined, « key »).
...
features: [WeakMap]
--- |
1101 |
does-not-have-weakmapdata-internal-slot-array.js |
---
esid: proposal-upsert
description: >
Throws TypeError if `this` doesn't have a [[WeakMapData]] internal slot.
info: |
WeakMap.prototype.getOrInsertComputed ( key, callbackfn )
...
2. Perform ? RequireInternalSlot(M, [[WeakMapData]]).
...
--- |
815 |
does-not-have-weakmapdata-internal-slot-map.js |
---
esid: proposal-upsert
description: >
Throws TypeError if `this` doesn't have a [[WeakMapData]] internal slot.
info: |
WeakMap.prototype.getOrInsertComputed ( key, callbackfn )
...
2. Perform ? RequireInternalSlot(M, [[WeakMapData]]).
...
features: [Map]
--- |
845 |
does-not-have-weakmapdata-internal-slot-object.js |
---
esid: proposal-upsert
description: >
Throws TypeError if `this` doesn't have a [[WeakMapData]] internal slot.
info: |
WeakMap.prototype.getOrInsertComputed ( key, callbackfn )
...
2. Perform ? RequireInternalSlot(M, [[WeakMapData]]).
...
--- |
815 |
does-not-have-weakmapdata-internal-slot-set.js |
---
esid: proposal-upsert
description: >
Throws TypeError if `this` doesn't have a [[WeakMapData]] internal slot.
info: |
WeakMap.prototype.getOrInsertComputed ( key, callbackfn )
...
2. Perform ? RequireInternalSlot(M, [[WeakMapData]]).
...
features: [Set]
--- |
845 |
does-not-have-weakmapdata-internal-slot-weakmap-prototype.js |
---
esid: proposal-upsert
description: >
Throws TypeError if `this` doesn't have a [[WeakMapData]] internal slot.
info: |
WeakMap.prototype.getOrInsertComputed ( key, callbackfn )
...
2. Perform ? RequireInternalSlot(M, [[WeakMapData]]).
...
--- |
845 |
getOrInsertComputed.js |
---
esid: proposal-upsert
description: >
WeakMap.prototype.getOrInsertComputed property descriptor
info: |
WeakMap.prototype.getOrInsertComputed ( key, callbackfn )
17 ECMAScript Standard Built-in Objects
includes: [propertyHelper.js]
--- |
903 |
length.js |
---
esid: proposal-upsert
description: >
WeakMap.prototype.getOrInsertComputed.length descriptor
info: |
WeakMap.prototype.getOrInsertComputed ( key, callbackfn )
17 ECMAScript Standard Built-in Objects
includes: [propertyHelper.js]
--- |
734 |
name.js |
---
esid: proposal-upsert
description: >
WeakMap.prototype.getOrInsertComputed.name descriptor
info: |
WeakMap.prototype.getOrInsertComputed ( key, callbackfn )
17 ECMAScript Standard Built-in Objects
includes: [propertyHelper.js]
--- |
746 |
not-a-constructor.js |
---
esid: proposal-upsert
description: >
WeakMap.prototype.getOrInsertComputed does not implement [[Construct]], is not new-able
info: |
ECMAScript Function Objects
Built-in function objects that are not identified as constructors do not
implement the [[Construct]] internal method unless otherwise specified in
the description of a particular function.
sec-evaluatenew
...
7. If IsConstructor(constructor) is false, throw a TypeError exception.
...
includes: [isConstructor.js]
features: [Reflect.construct, WeakMap, arrow-function]
--- |
1131 |
not-a-function-callbackfn-throws.js |
---
esid: proposal-upsert
description: >
Throws a TypeError if `callbackfn` is not callable.
info: |
WeakMap.prototype.getOrInsertComputed ( key , callbackfn )
...
3. If IsCallable(callbackfn) is false, throw a TypeError exception.
...
features: [Symbol]
--- |
1428 |
overwrites-mutation-from-callbackfn.js |
---
esid: proposal-upsert
description: >
If the callbackfn inserts a value on the given key, the value is overwritten.
info: |
WeakMap.prototype.set ( key, value )
...
6. Let value be ? Call(callbackfn, undefined, « key »).
7. For each Record { [[Key]], [[Value]] } p of M.[[WeakMapData]], do
a. If p.[[Key]] is not empty and SameValue(p.[[Key]], key) is true, then
i. Set p.[[Value]] to value.
ii. Return value.
8. Let p be the Record { [[Key]]: key, [[Value]]: value }.
9. Append p to M.[[WeakMapData]].
...
--- |
1156 |
returns-value-if-key-is-not-present-object-key.js |
---
esid: proposal-upsert
description: >
Returns the value from the specified Object key
info: |
WeakMap.prototype.getOrInsertComputed ( key, callbackfn )
...
8. Let p be the Record { [[Key]]: key, [[Value]]: value }.
9. Append p to M.[[WeakMapData]].
10. Return value.
features: [WeakMap]
--- |
848 |
returns-value-if-key-is-not-present-symbol-key.js |
---
esid: proposal-upsert
description: >
Returns the value from the specified Symbol key
info: |
WeakMap.prototype.getOrInsertComputed ( key, callbackfn )
...
8. Let p be the Record { [[Key]]: key, [[Value]]: value }.
9. Append p to M.[[WeakMapData]].
10. Return value.
features: [Symbol, WeakMap, symbols-as-weakmap-keys]
--- |
1350 |
returns-value-if-key-is-present-object-key.js |
---
esid: proposal-upsert
description: >
Returns the value from the specified Object key
info: |
WeakMap.prototype.getOrInsertComputed ( key, callbackfn )
...
5. For each Record { [[Key]], [[Value]] } p of M.[[WeakMapData]], do
a. If p.[[Key]] is not empty and SameValue(p.[[Key]], key) is true, return p.[[Value]].
...
features: [WeakMap]
--- |
948 |
returns-value-if-key-is-present-symbol-key.js |
---
esid: proposal-upsert
description: >
Returns the value from the specified Symbol key
info: |
WeakMap.prototype.getOrInsertComputed ( key, callbackfn )
...
5. For each Record { [[Key]], [[Value]] } p of M.[[WeakMapData]], do
a. If p.[[Key]] is not empty and SameValue(p.[[Key]], key) is true, return p.[[Value]].
...
features: [Symbol, WeakMap, symbols-as-weakmap-keys]
--- |
1486 |
this-not-object-throw.js |
---
esid: proposal-upsert
description: >
Throws a TypeError if `this` is not an Object.
info: |
WeakMap.prototype.getOrInsertComputed ( key , callbackfn )
1. Let M be the this value
2. Perform ? RequireInternalSlot(M, [[WeakMapData]])
...
features: [Symbol]
--- |
1364 |
throw-if-key-cannot-be-held-weakly.js |
---
esid: proposal-upsert
description: Throws TypeError if key cannot be held weakly.
info: |
WeakMap.prototype.getOrInsertComputed ( key, callbackfn )
...
4. If CanBeHeldWeakly(_key_) is *false*, throw a *TypeError* exception.
...
features: [Symbol, WeakMap]
--- |
1245 |