append-new-values-normalizes-zero-key.js |
---
esid: proposal-upsert
description: >
Append a new value in the map normalizing +0 and -0.
info: |
Map.prototype.getOrInsertComputed ( key , callbackfn )
...
4. Set key to CanonicalizeKeyedCollectionKey(key).
5. For each Record { [[Key]], [[Value]] } p of M.[[MapData]], do
a. If p.[[Key]] is not empty and SameValue(p.[[Key]], key) is true, return p.[[Value]].
6. Let value be ? Call(callbackfn, key).
7. Let p be the Record { [[Key]]: key, [[Value]]: value }.
8. Append p to M.[[MapData]].
...
features: [Symbol, arrow-function]
--- |
1056 |
append-new-values.js |
---
esid: proposal-upsert
description: >
Append a new value as the last element of entries.
info: |
Map.prototype.getOrInsertComputed ( key , callbackfn )
...
4. Set key to CanonicalizeKeyedCollectionKey(key).
5. For each Record { [[Key]], [[Value]] } p of M.[[MapData]], do
a. If p.[[Key]] is not empty and SameValue(p.[[Key]], key) is true, return p.[[Value]].
6. Let value be ? Call(callbackfn, key).
7. Let p be the Record { [[Key]]: key, [[Value]]: value }.
8. Append p to M.[[MapData]].
...
features: [Symbol, arrow-function]
--- |
1452 |
append-value-if-key-is-not-present-different-key-types.js |
---
esid: proposal-upsert
description: >
Inserts the value for the specified key on different types, when key not present.
info: |
Map.prototype.getOrInsertComputed ( key , callbackfn )
...
7. Let p be the Record { [[Key]]: key, [[Value]]: value }.
8. Append p to M.[[MapData]].
...
feature: [Symbol, arrow-function]
--- |
1314 |
callbackfn-throws.js |
---
esid: proposal-upsert
description: Map.getOrInsertComputed throws when callbackfn throws
return if abrubt completion Call(callbackfn, key)
info: |
Map.prototype.getOrInsertComputed ( key , callbackfn )
...
6. Let value be ? Call(callbackfn, key).
...
--- |
702 |
different-types-function-callbackfn-does-not-throw.js |
---
esid: proposal-upsert
description: >
Does not throw if `callbackfn` is callable.
info: |
Map.prototype.getOrInsertComputed ( key , callbackfn )
...
3. If IsCallable(callbackfn) is false, throw a TypeError exception.
...
features: [arrow-function]
--- |
1039 |
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]
--- |
1097 |
does-not-have-mapdata-internal-slot-set.js |
---
esid: proposal-upsert
description: >
Throws a TypeError if `this` is a Set Object
info: |
Map.prototype.getOrInsertComputed ( key , callbackfn )
...
1. Let M be the this value.
2. Perform ? RequireInternalSlot(M, [[MapData]])
...
features: [Set, arrow-function]
--- |
862 |
does-not-have-mapdata-internal-slot-weakmap.js |
---
esid: proposal-upsert
description: >
Throws a TypeError if `this` is a WeakMap object.
info: |
Map.prototype.getOrInsertComputed ( key , callbackfn )
...
1. Let M be the this value.
2. Perform ? RequireInternalSlot(M, [[MapData]]).
...
features: [WeakMap, arrow-function]
--- |
878 |
does-not-have-mapdata-internal-slot.js |
---
esid: proposal-upsert
description: >
Throws a TypeError if `this` object does not have a [[MapData]] internal slot.
info: |
Map.getOrInsertComputed ( key , callbackfn )
...
1. Let M be the this value.
2. Perform ? RequireInternalSlot(M, [[MapData]]).
...
features: [arrow-function]
--- |
1100 |
getOrInsertComputed.js |
---
esid: proposal-upsert
description: >
Property type and descriptor.
info: |
Map.prototype.getOrInsertComputed ( key , callbackfn )
17 ECMAScript Standard Built-in Objects
includes: [propertyHelper.js]
features: [arrow-function]
--- |
897 |
length.js |
---
esid: proposal-upsert
description: >
Map.prototype.getOrInsert.length value and descriptor.
info: |
Map.prototype.getOrInsertComputed ( key , callbackfn )
17 ECMAScript Standard Built-in Objects
includes: [propertyHelper.js]
--- |
736 |
name.js |
---
esid: proposal-upsert
description: >
Map.prototype.getOrInsertComputed.name value and descriptor.
info: |
Map.prototype.getOrInsertComputed ( key , callbackfn )
17 ECMAScript Standard Built-in Objects
includes: [propertyHelper.js]
--- |
760 |
not-a-constructor.js |
---
esid: proposal-upsert
description: >
Map.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, Map, arrow-function]
--- |
1101 |
not-a-function-callbackfn-throws.js |
---
esid: proposal-upsert
description: >
Throws a TypeError if `callbackfn` is not callable.
info: |
Map.prototype.getOrInsertComputed ( key , callbackfn )
...
3. If IsCallable(callbackfn) is false, throw a TypeError exception.
...
features: [Symbol]
--- |
1370 |
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]].
...
--- |
1145 |
returns-value-if-key-is-not-present-different-key-types.js |
---
esid: proposal-upsert
description: >
Returns the value from the specified key on different types, when key not present.
info: |
Map.prototype.getOrInsertComputed ( key , callbackfn )
...
7. Let p be the Record { [[Key]]: key, [[Value]]: value }.
8. Append p to M.[[MapData]].
9. Return p.[[Value]].
...
feature: [Symbol, arrow-function]
--- |
1217 |
returns-value-if-key-is-present-different-key-types.js |
---
esid: proposal-upsert
description: >
Returns the value set before getOrInsertComputed from the specified key on different types.
info: |
Map.prototype.getOrInsertComputed ( key , callbackfn )
...
5. For each Record { [[Key]], [[Value]] } p of M.[[MapData]], do
a. If p.[[Key]] is not empty and SameValue(p.[[Key]], key) is true, return p.[[Value]].
...
features: [Symbol, arrow-function]
--- |
1932 |
returns-value-normalized-zero-key.js |
---
esid: proposal-upsert
description: >
Returns the value from the specified key normalizing +0 and -0.
info: |
Map.prototype.getOrInsertComputed ( key , Callbackfn )
4. Set key to CanonicalizeKeyedCollectionKey(key).
5. For each Record { [[Key]], [[Value]] } p of M.[[MapData]], do
a. If p.[[Key]] is not empty and SameValue(p.[[Key]], key) is true, return p.[[Value]].
...
features: [arrow-function]
--- |
928 |
this-not-object-throw.js |
---
esid: proposal-upsert
description: >
Throws a TypeError if `this` is not an Object.
info: |
Map.prototype.getOrInsertComputed ( key , callbackfn )
1. Let M be the this value
2. Perform ? RequireInternalSlot(M, [[MapData]])
...
features: [Symbol, arrow-function]
--- |
1254 |