@@ -6909,12 +6909,66 @@ <h1>
6909
6909
<h1>Operations on Iterator Objects</h1>
6910
6910
<p>See Common Iteration Interfaces (<emu-xref href="#sec-iteration"></emu-xref>).</p>
6911
6911
6912
+ <emu-clause id="sec-iterator-records">
6913
+ <h1>Iterator Records</h1>
6914
+ <p>An <dfn variants="Iterator Records">Iterator Record</dfn> is a Record value used to encapsulate an Iterator or AsyncIterator along with the `next` method.</p>
6915
+ <p>Iterator Records have the fields listed in <emu-xref href="#table-iterator-record-fields"></emu-xref>.</p>
6916
+ <emu-table id="table-iterator-record-fields" caption="Iterator Record Fields">
6917
+ <table>
6918
+ <tr>
6919
+ <th>
6920
+ Field Name
6921
+ </th>
6922
+ <th>
6923
+ Value
6924
+ </th>
6925
+ <th>
6926
+ Meaning
6927
+ </th>
6928
+ </tr>
6929
+ <tr>
6930
+ <td>
6931
+ [[Iterator]]
6932
+ </td>
6933
+ <td>
6934
+ An object
6935
+ </td>
6936
+ <td>
6937
+ An object that conforms to the <i>Iterator</i> or <i>AsyncIterator</i> interface.
6938
+ </td>
6939
+ </tr>
6940
+ <tr>
6941
+ <td>
6942
+ [[NextMethod]]
6943
+ </td>
6944
+ <td>
6945
+ A function object
6946
+ </td>
6947
+ <td>
6948
+ The `next` method of the [[Iterator]] object.
6949
+ </td>
6950
+ </tr>
6951
+ <tr>
6952
+ <td>
6953
+ [[Done]]
6954
+ </td>
6955
+ <td>
6956
+ Boolean
6957
+ </td>
6958
+ <td>
6959
+ Whether the iterator has been closed.
6960
+ </td>
6961
+ </tr>
6962
+ </table>
6963
+ </emu-table>
6964
+ </emu-clause>
6965
+
6912
6966
<emu-clause id="sec-getiterator" type="abstract operation">
6913
6967
<h1>
6914
6968
GetIterator (
6915
- _obj_: unknown ,
6969
+ _obj_: an ECMAScript language value ,
6916
6970
optional _hint_: ~sync~ or ~async~,
6917
- optional _method_: unknown ,
6971
+ optional _method_: a function object ,
6918
6972
)
6919
6973
</h1>
6920
6974
<dl class="header">
@@ -6932,16 +6986,16 @@ <h1>
6932
6986
1. Let _iterator_ be ? Call(_method_, _obj_).
6933
6987
1. If Type(_iterator_) is not Object, throw a *TypeError* exception.
6934
6988
1. Let _nextMethod_ be ? GetV(_iterator_, *"next"*).
6935
- 1. Let _iteratorRecord_ be the Record { [[Iterator]]: _iterator_, [[NextMethod]]: _nextMethod_, [[Done]]: *false* }.
6989
+ 1. Let _iteratorRecord_ be the Iterator Record { [[Iterator]]: _iterator_, [[NextMethod]]: _nextMethod_, [[Done]]: *false* }.
6936
6990
1. Return _iteratorRecord_.
6937
6991
</emu-alg>
6938
6992
</emu-clause>
6939
6993
6940
6994
<emu-clause id="sec-iteratornext" type="abstract operation">
6941
6995
<h1>
6942
6996
IteratorNext (
6943
- _iteratorRecord_: unknown ,
6944
- optional _value_: unknown ,
6997
+ _iteratorRecord_: an Iterator Record ,
6998
+ optional _value_: an ECMAScript language value ,
6945
6999
)
6946
7000
</h1>
6947
7001
<dl class="header">
@@ -6985,7 +7039,7 @@ <h1>
6985
7039
<emu-clause id="sec-iteratorstep" type="abstract operation">
6986
7040
<h1>
6987
7041
IteratorStep (
6988
- _iteratorRecord_: unknown ,
7042
+ _iteratorRecord_: an Iterator Record ,
6989
7043
)
6990
7044
</h1>
6991
7045
<dl class="header">
@@ -7003,7 +7057,7 @@ <h1>
7003
7057
<emu-clause id="sec-iteratorclose" type="abstract operation">
7004
7058
<h1>
7005
7059
IteratorClose (
7006
- _iteratorRecord_: unknown ,
7060
+ _iteratorRecord_: an Iterator Record ,
7007
7061
_completion_: a Completion Record,
7008
7062
)
7009
7063
</h1>
@@ -7042,7 +7096,7 @@ <h1>IfAbruptCloseIterator ( _value_, _iteratorRecord_ )</h1>
7042
7096
<emu-clause id="sec-asynciteratorclose" type="abstract operation">
7043
7097
<h1>
7044
7098
AsyncIteratorClose (
7045
- _iteratorRecord_: unknown ,
7099
+ _iteratorRecord_: an Iterator Record ,
7046
7100
_completion_: a Completion Record,
7047
7101
)
7048
7102
</h1>
@@ -7069,7 +7123,7 @@ <h1>
7069
7123
<emu-clause id="sec-createiterresultobject" type="abstract operation">
7070
7124
<h1>
7071
7125
CreateIterResultObject (
7072
- _value_: unknown ,
7126
+ _value_: an ECMAScript language value ,
7073
7127
_done_: a Boolean,
7074
7128
)
7075
7129
</h1>
@@ -7088,7 +7142,7 @@ <h1>
7088
7142
<emu-clause id="sec-createlistiteratorRecord" type="abstract operation" oldids="sec-createlistiterator,sec-listiteratornext-functions,sec-listiterator-next">
7089
7143
<h1>
7090
7144
CreateListIteratorRecord (
7091
- _list_: unknown ,
7145
+ _list_: a List ,
7092
7146
)
7093
7147
</h1>
7094
7148
<dl class="header">
@@ -7101,7 +7155,7 @@ <h1>
7101
7155
1. Perform ? GeneratorYield(! CreateIterResultObject(_E_, *false*)).
7102
7156
1. Return *undefined*.
7103
7157
1. Let _iterator_ be ! CreateIteratorFromClosure(_closure_, ~empty~, %IteratorPrototype%).
7104
- 1. Return Record { [[Iterator]]: _iterator_, [[NextMethod]]: %GeneratorFunction.prototype.prototype.next%, [[Done]]: *false* }.
7158
+ 1. Return the Iterator Record { [[Iterator]]: _iterator_, [[NextMethod]]: %GeneratorFunction.prototype.prototype.next%, [[Done]]: *false* }.
7105
7159
</emu-alg>
7106
7160
<emu-note>
7107
7161
<p>The list iterator object is never directly accessible to ECMAScript code.</p>
@@ -7111,8 +7165,8 @@ <h1>
7111
7165
<emu-clause id="sec-iterabletolist" type="abstract operation">
7112
7166
<h1>
7113
7167
IterableToList (
7114
- _items_: unknown ,
7115
- optional _method_: unknown ,
7168
+ _items_: an ECMAScript language value ,
7169
+ optional _method_: a function object ,
7116
7170
)
7117
7171
</h1>
7118
7172
<dl class="header">
@@ -21958,7 +22012,7 @@ <h1>
21958
22012
1. Let _obj_ be ! ToObject(_exprValue_).
21959
22013
1. Let _iterator_ be ? EnumerateObjectProperties(_obj_).
21960
22014
1. Let _nextMethod_ be ! GetV(_iterator_, *"next"*).
21961
- 1. Return the Record { [[Iterator]]: _iterator_, [[NextMethod]]: _nextMethod_, [[Done]]: *false* }.
22015
+ 1. Return the Iterator Record { [[Iterator]]: _iterator_, [[NextMethod]]: _nextMethod_, [[Done]]: *false* }.
21962
22016
1. Else,
21963
22017
1. Assert: _iterationKind_ is ~iterate~ or ~async-iterate~.
21964
22018
1. If _iterationKind_ is ~async-iterate~, let _iteratorHint_ be ~async~.
@@ -42876,13 +42930,13 @@ <h1>
42876
42930
</h1>
42877
42931
<dl class="header">
42878
42932
<dt>description</dt>
42879
- <dd>It is used to create an async iterator Record from a synchronous iterator Record.</dd>
42933
+ <dd>It is used to create an async Iterator Record from a synchronous Iterator Record.</dd>
42880
42934
</dl>
42881
42935
<emu-alg>
42882
42936
1. Let _asyncIterator_ be ! OrdinaryObjectCreate(%AsyncFromSyncIteratorPrototype%, « [[SyncIteratorRecord]] »).
42883
42937
1. Set _asyncIterator_.[[SyncIteratorRecord]] to _syncIteratorRecord_.
42884
42938
1. Let _nextMethod_ be ! Get(_asyncIterator_, *"next"*).
42885
- 1. Let _iteratorRecord_ be the Record { [[Iterator]]: _asyncIterator_, [[NextMethod]]: _nextMethod_, [[Done]]: *false* }.
42939
+ 1. Let _iteratorRecord_ be the Iterator Record { [[Iterator]]: _asyncIterator_, [[NextMethod]]: _nextMethod_, [[Done]]: *false* }.
42886
42940
1. Return _iteratorRecord_.
42887
42941
</emu-alg>
42888
42942
</emu-clause>
@@ -42986,7 +43040,7 @@ <h1>Properties of Async-from-Sync Iterator Instances</h1>
42986
43040
[[SyncIteratorRecord]]
42987
43041
</td>
42988
43042
<td>
42989
- A Record, of the type returned by GetIterator, representing the original synchronous iterator which is being adapted.
43043
+ An Iterator Record representing the original synchronous iterator which is being adapted.
42990
43044
</td>
42991
43045
</tr>
42992
43046
</table>
0 commit comments