| constructor.js |
---
es6id: 23.1.1
description: >
The Map constructor is the %Map% intrinsic object and the initial value of the
Map property of the global object.
--- |
368 |
- |
| does-not-throw-when-set-is-not-callable.js |
---
es6id: 23.1.1.1
description: >
Creating a new Map object without arguments doesn't throw if `set` is not
callable
info: |
Map ( [ iterable ] )
When the Set function is called with optional argument iterable the following steps are taken:
...
5. If iterable is not present, let iterable be undefined.
6. If iterable is either undefined or null, let iter be undefined.
7. Else,
a. Let adder be Get(map, "set").
b. ReturnIfAbrupt(adder).
c. If IsCallable(adder) is false, throw a TypeError exception.
...
8. If iter is undefined, return map.
...
--- |
840 |
- |
| get-set-method-failure.js |
---
es6id: 23.1.1.1
description: >
new Map returns abrupt from getting Map.prototype.set.
info: |
Map ( [ iterable ] )
...
7. Else,
a. Let adder be Get(map, "add").
b. ReturnIfAbrupt(adder).
--- |
532 |
- |
| iterable-calls-set.js |
---
es6id: 23.1.1.1
description: >
new Map calls `set` for each item on the iterable argument in order.
info: |
Map ( [ iterable ] )
...
9. Repeat
...
k. Let status be Call(adder, map, «k.[[value]], v.[[value]]»).
...
includes: [compareArray.js]
--- |
929 |
- |
| iterator-close-after-set-failure.js |
---
es6id: 23.1.1.1
description: >
The iterator is closed when `Map.prototype.set` throws an error.
info: |
Map ( [ iterable ] )
...
9. Repeat
...
k. Let status be Call(adder, map, «k.[[value]], v.[[value]]»).
l. If status is an abrupt completion, return IteratorClose(iter, status).
features: [Symbol.iterator]
--- |
877 |
- |
| iterator-is-undefined-throws.js |
---
esid: sec-map-objects
description: >
Throws a TypeError if the iterator of the iterable is undefined.
info: |
Map ( [ iterable ] )
...
9. Let iteratorRecord be ? GetIterator(iterable).
features: [Symbol.iterator]
--- |
481 |
- |
| iterator-item-first-entry-returns-abrupt.js |
---
es6id: 23.1.1.1
description: >
Closes iterator if item first entry completes abruptly.
info: |
Map ( [ iterable ] )
...
9. Repeat
...
d. Let nextItem be IteratorValue(next).
...
g. Let k be Get(nextItem, "0").
h. If k is an abrupt completion, return IteratorClose(iter, k).
...
features: [Symbol.iterator]
--- |
976 |
- |
| iterator-item-second-entry-returns-abrupt.js |
---
es6id: 23.1.1.1
description: >
Closes iterator if item second entry completes abruptly.
info: |
Map ( [ iterable ] )
...
9. Repeat
...
d. Let nextItem be IteratorValue(next).
...
i. Let v be Get(nextItem, "1").
j. If v is an abrupt completion, return IteratorClose(iter, v).
...
features: [Symbol.iterator]
--- |
977 |
- |
| iterator-items-are-not-object-close-iterator.js |
---
es6id: 23.1.1.1
description: >
Closes the iterator after `not Object` error.
info: |
Map ( [ iterable ] )
...
9. Repeat
...
d. Let nextItem be IteratorValue(next).
e. ReturnIfAbrupt(nextItem).
f. If Type(nextItem) is not Object,
i. Let error be Completion{[[type]]: throw, [[value]]: a newly created
TypeError object, [[target]]:empty}.
ii. Return IteratorClose(iter, error).
features:
- Symbol
- Symbol.iterator
--- |
1528 |
- |
| iterator-items-are-not-object.js |
---
es6id: 23.1.1.1
description: >
Throws a TypeError if iterable items are not Objects.
info: |
Map ( [ iterable ] )
...
9. Repeat
...
d. Let nextItem be IteratorValue(next).
e. ReturnIfAbrupt(nextItem).
f. If Type(nextItem) is not Object,
i. Let error be Completion{[[type]]: throw, [[value]]: a newly created
TypeError object, [[target]]:empty}.
ii. Return IteratorClose(iter, error).
features: [Symbol]
--- |
1056 |
- |
| iterator-next-failure.js |
---
es6id: 23.1.1.1
description: >
The iterator is closed when iterable `next` throws an error.
info: |
Map ( [ iterable ] )
...
9. Repeat
a. Let next be IteratorStep(iter).
b. ReturnIfAbrupt(next).
features: [Symbol.iterator]
--- |
598 |
- |
| iterator-value-failure.js |
---
es6id: 23.1.1.1
description: >
The iterator is closed when iterable `next` value throws an error.
info: |
Map ( [ iterable ] )
...
9. Repeat
...
d. Let nextItem be IteratorValue(next).
e. ReturnIfAbrupt(nextItem).
features: [Symbol.iterator]
--- |
702 |
- |
| length.js |
---
es6id: 23.1.2
description: Map.length is 0.
info: |
Properties of the Map Constructor
Besides the length property (whose value is 0)
includes: [propertyHelper.js]
--- |
490 |
- |
| map-iterable-empty-does-not-call-set.js |
---
es6id: 23.1.1.1
description: >
A Map constructed with an empty iterable argument does not call set.
info: |
Map ( [ iterable ] )
When the Map function is called with optional argument the following steps are
taken:
...
8. If iter is undefined, return map.
9. Repeat
a. Let next be IteratorStep(iter).
b. ReturnIfAbrupt(next).
c. If next is false, return map.
--- |
748 |
- |
| map-iterable-throws-when-set-is-not-callable.js |
---
es6id: 23.1.1.1
description: >
Throws a TypeError if `set` is not callable on Map constructor with a
iterable argument.
info: |
Map ( [ iterable ] )
When the Map function is called with optional argument the following steps are
taken:
...
5. If iterable is not present, let iterable be undefined.
6. If iterable is either undefined or null, let iter be undefined.
7. Else,
a. Let adder be Get(map, "set").
b. ReturnIfAbrupt(adder).
c. If IsCallable(adder) is false, throw a TypeError exception.
--- |
788 |
- |
| map-iterable.js |
---
es6id: 23.1.1.1
description: >
Contructor returns a map object set with the elements from the iterable
argument.
info: |
Map ( [ iterable ] )
...
9. Repeat
a. Let next be IteratorStep(iter).
b. ReturnIfAbrupt(next).
c. If next is false, return map.
...
--- |
614 |
- |
| map-no-iterable-does-not-call-set.js |
---
es6id: 23.1.1.1
description: >
A Map constructed without a iterable argument does not call set.
info: |
Map ( [ iterable ] )
When the Map function is called with optional argument the following steps are
taken:
...
5. If iterable is not present, let iterable be undefined.
6. If iterable is either undefined or null, let iter be undefined.
7. Else,
a. Let adder be Get(map, "set").
b. ReturnIfAbrupt(adder).
c. If IsCallable(adder) is false, throw a TypeError exception.
d. Let iter be GetIterator(iterable).
e. ReturnIfAbrupt(iter).
8. If iter is undefined, return map.
--- |
970 |
- |
| map-no-iterable.js |
---
es6id: 23.1.1.1
description: >
Returns the new Map object with the new empty list if the iterable argument is
undefined.
info: |
Map ( [ iterable ] )
...
2. Let map be OrdinaryCreateFromConstructor(NewTarget, "%MapPrototype%",
«[[MapData]]» ).
...
4. Map map’s [[MapData]] internal slot to a new empty List.
5. If iterable is not present, let iterable be undefined.
6. If iterable is either undefined or null, let iter be undefined.
...
8. If iter is undefined, return map.
--- |
1036 |
- |
| map.js |
---
es6id: 23.1.1.1
description: >
Map descriptor as a standard built-in object.
info: |
Map ( [ iterable ] )
17 ECMAScript Standard Built-in Objects
includes: [propertyHelper.js]
--- |
431 |
- |
| name.js |
---
es6id: 23.1.1.1
description: Map.name value and descriptor.
info: |
Map ( [ iterable ] )
17 ECMAScript Standard Built-in Objects
includes: [propertyHelper.js]
--- |
485 |
- |
| newtarget.js |
---
es6id: 23.1.1.1
description: >
The new Map object's prototype is Map.prototype
info: |
Map ( [ iterable ] )
When the Map function is called with optional argument the following steps
are taken:
...
2. Let map be OrdinaryCreateFromConstructor(NewTarget, "%MapPrototype%",
«[[MapData]]» ).
...
--- |
778 |
- |
| properties-of-map-instances.js |
---
es6id: 23.1.4
description: >
Map instances are ordinary objects that inherit properties from the Map
prototype.
--- |
404 |
- |
| properties-of-the-map-prototype-object.js |
---
es6id: 23.1.3
description: >
The prototype of Map.prototype is Object.prototype.
info: |
The Map prototype object is the intrinsic object %MapPrototype%. The value
of the [[Prototype]] internal slot of the Map prototype object is the
intrinsic object %ObjectPrototype% (19.1.3). The Map prototype object is an
ordinary object. It does not have a [[MapData]] internal slot.
--- |
681 |
- |
| proto-from-ctor-realm.js |
---
esid: sec-map-iterable
es6id: 23.1.1.1
description: Default [[Prototype]] value derived from realm of the newTarget
info: |
[...]
3. Let map be ? OrdinaryCreateFromConstructor(NewTarget, "%MapPrototype%",
« [[MapData]] »).
[...]
9.1.14 GetPrototypeFromConstructor
[...]
3. Let proto be ? Get(constructor, "prototype").
4. If Type(proto) is not Object, then
a. Let realm be ? GetFunctionRealm(constructor).
b. Let proto be realm's intrinsic object named intrinsicDefaultProto.
[...]
features: [cross-realm, Reflect]
--- |
918 |
- |
| prototype |
|
|
- |
| prototype-of-map.js |
---
es6id: 23.1.2
description: >
The prototype of Map is the intrinsic FunctionPrototype.
info: |
The value of the [[Prototype]] internal slot of the Map constructor is the
intrinsic object %FunctionPrototype% (19.2.3).
--- |
508 |
- |
| symbol-as-entry-key.js |
---
es6id: 19.4
description: >
Symbol as Map key
features: [Symbol]
--- |
656 |
- |
| Symbol.species |
|
|
- |
| undefined-newtarget.js |
---
es6id: 23.1.1.1
description: >
Throws a TypeError if Map is called without a newTarget.
info: |
Map ( [ iterable ] )
When the Map function is called with optional argument the following steps
are taken:
1. If NewTarget is undefined, throw a TypeError exception.
...
--- |
537 |
- |