@@ -78,6 +78,7 @@ urlPrefix: https://tc39.github.io/ecma262/; spec: ECMA-262
78
78
text: Array; url: sec-array-objects
79
79
text: ArrayBuffer; url: sec-arraybuffer-objects
80
80
text: DataView; url: sec-dataview-objects
81
+ text: Iterator; url: sec-iterator-interface
81
82
text: Map; url: sec-map-objects
82
83
text: Promise; url: sec-promise-objects
83
84
text: Set; url: sec-set-objects
@@ -191,6 +192,7 @@ urlPrefix: https://tc39.github.io/ecma262/; spec: ECMA-262
191
192
url: sec-object-internal-methods-and-internal-slots
192
193
text: internal method
193
194
text: internal slot
195
+ text: essential internal method
194
196
text: Number type; url: sec-ecmascript-language-types-number-type
195
197
text: Object; for: ECMAScript; url: sec-object-type
196
198
for: ordinary object; url: sec-ordinary-object-internal-methods-and-internal-slots
@@ -6719,17 +6721,6 @@ shall be treated in accordance with the rules for exotic objects.
6719
6721
{{HTMLAllCollection}} and {{Location}} interfaces. [[HTML]]</span>
6720
6722
</p>
6721
6723
6722
- Unless otherwise specified, exotic objects defined in this section and other specifications have the
6723
- same [=ordinary object/internal slots=] as ordinary objects, and all of the internal methods for
6724
- which alternative definitions are not given are the same as [=ordinary object/internal
6725
- methods|those=] of ordinary objects.
6726
-
6727
- Unless otherwise specified, the \[[Extensible]] internal slot
6728
- of objects defined in this section has the value <emu-val>true</emu-val>.
6729
-
6730
- Unless otherwise specified, the \[[Prototype]] internal slot
6731
- of objects defined in this section is {{%ObjectPrototype%}}.
6732
-
6733
6724
Unless otherwise specified, the {{ECMAScript/typeof}} operator, when called on an
6734
6725
exotic object that is not a [=function object=] defined in this section and
6735
6726
other specifications, must return the string "<code>object</code>".
@@ -10960,11 +10951,12 @@ for that interface on which named properties are exposed.
10960
10951
1. If |interface| is declared to inherit from another interface,
10961
10952
then set |proto| to the [=interface prototype object=] in |realm| for the [=inherited interface=].
10962
10953
1. Otherwise, set |proto| to |realm|.\[[Intrinsics]].[[{{%ObjectPrototype%}}]].
10963
- 1. Let |obj| be a newly created object.
10964
- 1. Set |obj|'s internal methods to the definitions specified in
10954
+ 1. Let |obj| be a newly created object, with the same internal slots as those of ordinary
10955
+ objects specified in [=ECMA-262 Ordinary object internal methods and internal slots=].
10956
+ 1. Set |obj|'s [=essential internal methods=] to the definitions specified in
10965
10957
[=ECMA-262 Ordinary object internal methods and internal slots=],
10966
10958
unless they are specified in the the rest of [[#named-properties-object]].
10967
- 1. Set |obj|'s remaining internal methods to the definitions specified below.
10959
+ 1. Set |obj|'s remaining [=essential internal methods=] to the definitions specified below.
10968
10960
1. Set |obj|.\[[Prototype]] to |proto|.
10969
10961
1. Set |obj|.\[[Extensible]] to <emu-val>true</emu-val>.
10970
10962
1. Return |obj|.
@@ -11872,12 +11864,16 @@ The value of the [=function object=]’s <code class="idl">name</code> property
11872
11864
11873
11865
A <dfn id="dfn-default-iterator-object" export>default iterator object</dfn> for a given
11874
11866
[=interface=], target and iteration kind
11875
- is an object whose \[[Prototype]] [=internal slot=] is the
11867
+ is an ordinary object that implements the {{Iterator}} ECMAScript interface.
11868
+
11869
+ The initial value of the \[[Prototype]] [=internal slot=] of a [=default iterator object=] is the
11876
11870
[=iterator prototype object=]
11877
11871
for the [=interface=].
11878
11872
11879
- A [=default iterator object=]
11880
- has three internal values:
11873
+ The initial value of the \[[Extensible]] [=internal slot=] of a [=default iterator object=] is
11874
+ <emu-val>true</emu-val>.
11875
+
11876
+ A [=default iterator object=] has three internal values:
11881
11877
11882
11878
1. its <em>target</em>, which is an object whose values are to be iterated,
11883
11879
1. its <em>kind</em>, which is the iteration kind,
@@ -11897,19 +11893,24 @@ class="idl">Object.prototype.toString()</code> is called on a [=default
11897
11893
iterator object=] of a given [=interface=], the [=class string=] of the
11898
11894
[=iterator prototype object=] of that [=interface=] is used.
11899
11895
11896
+ Issue: Define creation of a [=default iterator object=] imperatively instead.
11897
+
11900
11898
11901
11899
<h5 id="es-iterator-prototype-object">Iterator prototype object</h5>
11902
11900
11903
11901
The <dfn id="dfn-iterator-prototype-object" export>iterator prototype object</dfn>
11904
11902
for a given [=interface=]
11905
- is an object that exists for every interface that has a
11903
+ is an ordinary object that exists for every interface that has a
11906
11904
[=pair iterator=]. It serves as the
11907
11905
prototype for [=default iterator objects=]
11908
11906
for the interface.
11909
11907
11910
- The \[[Prototype]] [=internal slot=] of an [=iterator prototype object=]
11908
+ The initial value of the \[[Prototype]] [=internal slot=] of an [=iterator prototype object=]
11911
11909
must be {{%IteratorPrototype%}}.
11912
11910
11911
+ The initial value of the \[[Extensible]] [=internal slot=] of an [=iterator prototype object=]
11912
+ must be <emu-val>true</emu-val>.
11913
+
11913
11914
<div algorithm="to invoke the next property of iterators">
11914
11915
11915
11916
An [=iterator prototype object=] must have a <code class="idl">next</code> data property with attributes
@@ -11961,6 +11962,8 @@ The [=class string=] of an [=iterator prototype object=] for a given [=interface
11961
11962
is the result of concatenating the [=identifier=] of the [=interface=]
11962
11963
and the string "<code> Iterator</code>".
11963
11964
11965
+ Issue: Define creation of an [=iterator prototype object=] imperatively instead.
11966
+
11964
11967
11965
11968
<h4 id="es-maplike">Maplike declarations</h4>
11966
11969
@@ -12405,13 +12408,14 @@ the Realm given as an argument.
12405
12408
1. Let |targetRealm| be [$GetFunctionRealm$](|newTarget|).
12406
12409
1. Set |prototype| to the [=interface prototype object=] for |interface| in
12407
12410
|targetRealm|.
12408
- 1. Let |slots| be « \[[Realm]], \[[PrimaryInterface]] ».
12409
- 1. Let |instance| be a newly created [=ECMAScript/object=] in |realm|
12410
- with an internal slot for each name in |slots|.
12411
+ 1. Let |instance| be a newly created [=ECMAScript/object=] in |realm|, with the same internal
12412
+ slots as those of ordinary objects specified in [=ECMA-262 Ordinary object internal
12413
+ methods and internal slots=], as well as \[[Realm]] and \[[PrimaryInterface]].
12414
+ 1. Set |instance|.\[[Prototype]] to |prototype|.
12415
+ 1. Set |instance|.\[[Extensible]] to <emu-val>true</emu-val>.
12411
12416
1. Set |instance|.\[[Realm]] to |realm|.
12412
12417
1. Set |instance|.\[[PrimaryInterface]] to |interface|.
12413
- 1. Set |instance|.\[[Prototype]] to |prototype|.
12414
- 1. Set |instance|'s essential internal methods to the definitions specified in
12418
+ 1. Set |instance|'s [=essential internal methods=] to the definitions specified in
12415
12419
[=ECMA-262 Ordinary object internal methods and internal slots=].
12416
12420
1. Let |interfaces| be the [=inclusive inherited interfaces=] of |interface|.
12417
12421
1. [=list/iterate|For every=] [=interface=] |ancestor interface| in |interfaces|:
0 commit comments