@@ -4119,8 +4119,9 @@ must not also have an
4119
4119
An interface with an [=iterable declaration=]
4120
4120
and its [=inherited interfaces=]
4121
4121
must not have a
4122
- [=maplike declaration=] or
4123
- [=setlike declaration=].
4122
+ [=maplike declaration=],
4123
+ [=setlike declaration=], or
4124
+ [=asynchronously iterable declaration=].
4124
4125
4125
4126
The following extended attributes are applicable to [=iterable declarations=]:
4126
4127
[{{Exposed}}],
@@ -4167,7 +4168,8 @@ iteration – or a tuple with three elements:
4167
4168
4168
4169
1. a value of the first type given in the declaration;
4169
4170
1. a value of the second type given in the declaration;
4170
- 1. an opaque value that is passed back to the next invocation of the algorithm,
4171
+ 1. an opaque value that is passed back to the next invocation of the algorithm as the
4172
+ <b>[=current state=]</b>.
4171
4173
4172
4174
The prose may also define <dfn>asynchronous iterator initialization steps</dfn> for the
4173
4175
[=interface=] with an [=asynchronously iterable declaration=], which would then be called with the
@@ -4205,17 +4207,18 @@ or have any [=inherited interfaces=] that have [=interface members=] with these
4205
4207
following steps:
4206
4208
4207
4209
1. Let |promise| be a new promise.
4208
- 1. Let |key| be as follows :
4210
+ 1. Let |key| be the following value, if it exists, or null otherwise :
4209
4211
<dl class="switch">
4210
- : If <b>current state</b> is not given
4211
- :: the username in <b>this</b>'s open sessions that is first in lexicographical
4212
- order
4212
+ : If <b>current state</b> is "not yet started"
4213
+ :: the smallest username in <b>this</b>'s open sessions, in lexicographical order
4213
4214
4214
- : If <b>current state</b> is given
4215
- :: the username in <b>this</b>'s open sessions that is next in lexicographical
4216
- order, after <b>current state</b>
4215
+ : Otherwise
4216
+ :: the smallest username in <b>this</b>'s open sessions that is greater than
4217
+ <b>current state</b>, in lexicographical order
4217
4218
</dl>
4218
- 1. If there is no such |key|, then:
4219
+
4220
+ Note: <b>current state</b> might no longer be present in the open sessions.
4221
+ 1. If |key| is null, then:
4219
4222
1. Resolve |promise| with undefined.
4220
4223
1. Otherwise:
4221
4224
1. Let |session| be the <code class="idl">Session</code> object corresponding to |key|.
@@ -12062,15 +12065,16 @@ A [=default asynchronous iterator object=] has internal values:
12062
12065
* its <dfn for="default asynchronous iterator object">kind</dfn>, which is the iteration kind,
12063
12066
* its <dfn for="default asynchronous iterator object">ongoing promise</dfn>, which is a
12064
12067
{{Promise}} or undefined,
12065
- * its <dfn for="default asynchronous iterator object">state</dfn>, which is an opaque value used
12066
- to store the position of the iterator by the algorithm to [=get the next iteration result=], or
12067
- null .
12068
+ * its <dfn for="default asynchronous iterator object">state</dfn>, which is one of
12069
+ "not yet started" and "finished", or an opaque value used to store the position of the iterator
12070
+ by the algorithm to [=get the next iteration result=] .
12068
12071
12069
12072
Note: This value is associated with the iterator instance, rather than the [=interface=]
12070
12073
instance. It is explicitly handled here because the iterator instance is not exposed to the
12071
12074
prose that [=get the next iteration result|gets the next iteration result=].
12072
12075
12073
- When a [=default asynchronous iterator object=] is first created, its state is not given.
12076
+ When a [=default asynchronous iterator object=] is first created, its
12077
+ [=default asynchronous iterator object/state=] is "not yet started".
12074
12078
12075
12079
Note: [=Default asynchronous iterator objects=] do not have [=class strings=]; when
12076
12080
<code class="idl">Object.prototype.toString()</code> is called on a
@@ -12126,7 +12130,7 @@ The \[[Prototype]] [=internal slot=] of an [=asynchronous iterator prototype obj
12126
12130
1. Let |nextSteps| be the following steps:
12127
12131
1. Let |nextPromiseCapability| be [=!=] [$NewPromiseCapability$]({{%Promise%}}).
12128
12132
1. Let |oldState| be |object|'s [=default asynchronous iterator object/state=].
12129
- 1. If |oldState| is null , then:
12133
+ 1. If |oldState| is "finished" , then:
12130
12134
1. Let |result| be [$CreateIterResultObject$](<emu-val>undefined</emu-val>,
12131
12135
<emu-val>true</emu-val>).
12132
12136
1. Perform [=!=] [$Call$](|nextPromiseCapability|.\[[Resolve]],
0 commit comments