Skip to content

Commit 284039d

Browse files
committed
fixup! Add async_iterable support
1 parent 894034a commit 284039d

File tree

1 file changed

+20
-16
lines changed

1 file changed

+20
-16
lines changed

index.bs

+20-16
Original file line numberDiff line numberDiff line change
@@ -4119,8 +4119,9 @@ must not also have an
41194119
An interface with an [=iterable declaration=]
41204120
and its [=inherited interfaces=]
41214121
must not have a
4122-
[=maplike declaration=] or
4123-
[=setlike declaration=].
4122+
[=maplike declaration=],
4123+
[=setlike declaration=], or
4124+
[=asynchronously iterable declaration=].
41244125

41254126
The following extended attributes are applicable to [=iterable declarations=]:
41264127
[{{Exposed}}],
@@ -4167,7 +4168,8 @@ iteration – or a tuple with three elements:
41674168

41684169
1. a value of the first type given in the declaration;
41694170
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>.
41714173

41724174
The prose may also define <dfn>asynchronous iterator initialization steps</dfn> for the
41734175
[=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
42054207
following steps:
42064208

42074209
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:
42094211
<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
42134214

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
42174218
</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:
42194222
1. Resolve |promise| with undefined.
42204223
1. Otherwise:
42214224
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:
1206212065
* its <dfn for="default asynchronous iterator object">kind</dfn>, which is the iteration kind,
1206312066
* its <dfn for="default asynchronous iterator object">ongoing promise</dfn>, which is a
1206412067
{{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=].
1206812071

1206912072
Note: This value is associated with the iterator instance, rather than the [=interface=]
1207012073
instance. It is explicitly handled here because the iterator instance is not exposed to the
1207112074
prose that [=get the next iteration result|gets the next iteration result=].
1207212075

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".
1207412078

1207512079
Note: [=Default asynchronous iterator objects=] do not have [=class strings=]; when
1207612080
<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
1212612130
1. Let |nextSteps| be the following steps:
1212712131
1. Let |nextPromiseCapability| be [=!=] [$NewPromiseCapability$]({{%Promise%}}).
1212812132
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:
1213012134
1. Let |result| be [$CreateIterResultObject$](<emu-val>undefined</emu-val>,
1213112135
<emu-val>true</emu-val>).
1213212136
1. Perform [=!=] [$Call$](|nextPromiseCapability|.\[[Resolve]],

0 commit comments

Comments
 (0)