@@ -1692,7 +1692,7 @@ The type of the attribute, after resolving typedefs, must not be a
1692
1692
[=nullable type|nullable=] or non-nullable version of any of the following types:
1693
1693
1694
1694
* a [=sequence type=]
1695
- * an [=async iterable type=]
1695
+ * an [=async sequence type=]
1696
1696
* a [=dictionary type=]
1697
1697
* a [=record type=]
1698
1698
* a [=union type=]
@@ -3382,7 +3382,7 @@ the following algorithm returns <i>true</i>.
3382
3382
<th><div><span>interface-like</span></div>
3383
3383
<th><div><span>callback function</span></div>
3384
3384
<th><div><span>dictionary-like</span></div>
3385
- <th><div><span>async iterable </span></div>
3385
+ <th><div><span>async sequence </span></div>
3386
3386
<th><div><span>sequence-like</span></div>
3387
3387
</thead>
3388
3388
<tr>
@@ -3526,7 +3526,7 @@ the following algorithm returns <i>true</i>.
3526
3526
<td>●
3527
3527
<td>●
3528
3528
<tr>
3529
- <th>async iterable
3529
+ <th>async sequence
3530
3530
<td class="belowdiagonal">
3531
3531
<td class="belowdiagonal">
3532
3532
<td class="belowdiagonal">
@@ -3574,7 +3574,7 @@ the following algorithm returns <i>true</i>.
3574
3574
converted to a dictionary-like type.
3575
3575
</div>
3576
3576
1. The types are distinguishable, but when converting from an ECMAScript value,
3577
- a [=string object=] is never converted to an [=async iterable type=]
3577
+ a [=string object=] is never converted to an [=async sequence type=]
3578
3578
(even if it has a {{%Symbol.iterator%}} method), if a [=string type=]
3579
3579
is also in the overload set or union.
3580
3580
</ol>
@@ -4130,10 +4130,10 @@ An [=interface=] can be declared to be asynchronously iterable by using an
4130
4130
4131
4131
<pre highlight="webidl" class="syntax">
4132
4132
interface interface_identifier {
4133
- async iterable <value_type>;
4134
- async iterable <value_type>(/* arguments... */);
4135
- async iterable <key_type, value_type>;
4136
- async iterable <key_type, value_type>(/* arguments... */);
4133
+ async_iterable <value_type>;
4134
+ async_iterable <value_type>(/* arguments... */);
4135
+ async_iterable <key_type, value_type>;
4136
+ async_iterable <key_type, value_type>(/* arguments... */);
4137
4137
};
4138
4138
</pre>
4139
4139
@@ -4212,7 +4212,7 @@ or [=regular operations=] with these names.
4212
4212
interface SessionManager {
4213
4213
Session getSessionForUser(DOMString username);
4214
4214
4215
- async iterable <DOMString, Session>;
4215
+ async_iterable <DOMString, Session>;
4216
4216
};
4217
4217
4218
4218
[Exposed=Window]
@@ -4306,7 +4306,7 @@ When they are, the effect will be as you would expect.
4306
4306
4307
4307
<pre class="grammar" id="prod-AsyncIterable">
4308
4308
AsyncIterable :
4309
- "async" "iterable " "<" TypeWithExtendedAttributes OptionalType ">" OptionalArgumentList ";"
4309
+ "async_iterable " "<" TypeWithExtendedAttributes OptionalType ">" OptionalArgumentList ";"
4310
4310
</pre>
4311
4311
4312
4312
<pre class="grammar" id="prod-OptionalArgumentList">
@@ -5728,7 +5728,7 @@ are known as <dfn id="dfn-object-type" export>object types</dfn>.
5728
5728
StringType Null
5729
5729
identifier Null
5730
5730
"sequence" "<" TypeWithExtendedAttributes ">" Null
5731
- "async_iterable " "<" TypeWithExtendedAttributes ">" Null
5731
+ "async_sequence " "<" TypeWithExtendedAttributes ">" Null
5732
5732
"object" Null
5733
5733
"symbol" Null
5734
5734
BufferRelatedType Null
@@ -6223,32 +6223,32 @@ only [=list/items=] that are of type |T|.
6223
6223
6224
6224
<!-- Note: if we ever add synchronous iterable types, we should add a note here about why sequences and iterables are not the same. -->
6225
6225
6226
- <h4 id="idl-async-iterable-type" lt="async iterable " dfn export>Async iterable types — async iterable <|T|></h4>
6226
+ <h4 id="idl-async-iterable-type" lt="async_sequence| async sequence " dfn export>Async sequence types — async_sequence <|T|></h4>
6227
6227
6228
- An <dfn lt="async iterable type" export>async iterable type</dfn> is a parameterized
6228
+ An <dfn lt="async sequence type" export>async sequence type</dfn> is a parameterized
6229
6229
type whose values are references to objects that can produce an asynchronously iterable, possibly infinite,
6230
6230
sequence of values of type |T|.
6231
6231
6232
6232
Unlike [=sequences=], which are fixed-length lists where all values are known in advance, the asynchronously
6233
- iterable sequences created by async iterables are lazy. Their values may be produced asynchronously
6233
+ iterable sequences created by async sequences are lazy. Their values may be produced asynchronously
6234
6234
only during iteration, and thus the values or length might not be known at the time the async
6235
- iterable is created.
6235
+ sequence is created.
6236
6236
6237
- Async iterables are passed by reference in language bindings where they are represented by an object.
6238
- This means that passing an async iterable to a [=platform object=] will result in a reference to the
6239
- async iterable being kept by that object. Similarly, any async iterable returned from a platform
6237
+ Async sequences are passed by reference in language bindings where they are represented by an object.
6238
+ This means that passing an async sequence to a [=platform object=] will result in a reference to the
6239
+ async sequence being kept by that object. Similarly, any async sequence returned from a platform
6240
6240
object will be a reference to the same object and modifications made to it will be visible to the
6241
6241
platform object. This is in contrast to sequences, which are always passed by value.
6242
6242
6243
- Note: Async iterables cannot be constructed from IDL. If returned from an operation, or used as the
6244
- type of a dictionary member, the async iterable will have originated from the host environment and
6245
- have been turned into an IDL type via a language binding. Instead of returning an async iterable
6243
+ Note: Async sequences cannot be constructed from IDL. If returned from an operation, or used as the
6244
+ type of a dictionary member, the async sequence will have originated from the host environment and
6245
+ have been turned into an IDL type via a language binding. Instead of returning an async sequence
6246
6246
from an IDL operation, the operation might want to return an [=interface=] that has an
6247
6247
[=asynchronously iterable declaration=].
6248
6248
6249
- Async iterables must not be used as the type of an [=attribute=] or [=constant=].
6249
+ Async sequences must not be used as the type of an [=attribute=] or [=constant=].
6250
6250
6251
- There is no way to represent an async iterable value in IDL.
6251
+ There is no way to represent an async sequence value in IDL.
6252
6252
6253
6253
<h4 id="idl-record" lt="record" dfn export>Record types — record<|K|, |V|></h4>
6254
6254
@@ -8184,44 +8184,44 @@ JavaScript Array values.
8184
8184
</div>
8185
8185
8186
8186
8187
- <h4 id="js-async-iterable">Async iterables — async iterable <|T|></h4>
8187
+ <h4 id="js-async-iterable">Async sequences — async_sequence <|T|></h4>
8188
8188
8189
- In the JavaScript binding, IDL [=async iterable type|async iterable =] values are represented by
8189
+ In the JavaScript binding, IDL [=async sequence type|async sequence =] values are represented by
8190
8190
a [=struct=] with the following [=struct/items=]:
8191
8191
8192
- * <dfn for="JS async iterable ">object</dfn>, a JavaScript value
8193
- * <dfn for="JS async iterable ">method</dfn>, a JavaScript value
8194
- * <dfn for="JS async iterable ">type</dfn>, either "<code>sync</code>" or "<code>async</code>"
8192
+ * <dfn for="JS async sequence ">object</dfn>, a JavaScript value
8193
+ * <dfn for="JS async sequence ">method</dfn>, a JavaScript value
8194
+ * <dfn for="JS async sequence ">type</dfn>, either "<code>sync</code>" or "<code>async</code>"
8195
8195
8196
8196
8197
- <div id="js-to-async-iterable" algorithm="convert a JavaScript value to async iterable ">
8197
+ <div id="js-to-async-iterable" algorithm="convert a JavaScript value to async sequence ">
8198
8198
A JavaScript value |V| is [=converted to an IDL value|converted=]
8199
- to an IDL <a lt="async iterable">async iterable <<var ignore>T</var>></a> value as follows:
8199
+ to an IDL <a lt="async sequence">async_sequence <<var ignore>T</var>></a> value as follows:
8200
8200
8201
8201
1. If |V| [=is not an Object=], then
8202
8202
[=JavaScript/throw=] a <l spec=ecmascript>{{TypeError}}</l>.
8203
8203
1. Let |method| be [=?=] <a abstract-op>GetMethod</a>(obj, {{%Symbol.asyncIterator%}}).
8204
8204
1. If |method| is <emu-val>undefined</emu-val>:
8205
8205
1. Set |syncMethod| to [=?=] <a abstract-op>GetMethod</a>(obj, {{%Symbol.iterator%}}).
8206
8206
1. If |syncMethod| is undefined, [=JavaScript/throw=] a <l spec=ecmascript>{{TypeError}}</l>.
8207
- 1. Return an IDL [=async iterable =] value with [=JS async iterable /object=] set to |V|,
8208
- [=JS async iterable /method=] set to |syncMethod|, and [=JS async iterable /type=] set to
8207
+ 1. Return an IDL [=async sequence =] value with [=JS async sequence /object=] set to |V|,
8208
+ [=JS async sequence /method=] set to |syncMethod|, and [=JS async sequence /type=] set to
8209
8209
"<code>sync</code>".
8210
- 1. Return an IDL [=async iterable =] value with [=JS async iterable /object=] set to |V|,
8211
- [=JS async iterable /method=] set to |method|, and [=JS async iterable /type=] set to
8210
+ 1. Return an IDL [=async sequence =] value with [=JS async sequence /object=] set to |V|,
8211
+ [=JS async sequence /method=] set to |method|, and [=JS async sequence /type=] set to
8212
8212
"<code>async</code>".
8213
8213
</div>
8214
8214
8215
- <div id="async-iterable -to-js" algorithm="convert an async iterable to a JavaScript value">
8216
- An IDL <a lt="async iterable">async iterable <<var ignore>T</var>></a> value |V| is
8215
+ <div id="async-sequence -to-js" algorithm="convert an async sequence to a JavaScript value">
8216
+ An IDL <a lt="async sequence">async_sequence <<var ignore>T</var>></a> value |V| is
8217
8217
[=converted to a JavaScript value|converted=] to a JavaScript object as follows:
8218
8218
8219
- 1. Return |V|'s [=JS async iterable /object=].
8219
+ 1. Return |V|'s [=JS async sequence /object=].
8220
8220
</div>
8221
8221
8222
- <h5 id="js-async-iterator -iteration">Iterating async iterators </h5>
8222
+ <h5 id="js-async-sequence -iteration">Iterating async sequences </h5>
8223
8223
8224
- An [=async iterable =] is not directly iterated over. Instead, it is first opened to create
8224
+ An [=async sequence =] is not directly iterated over. Instead, it is first opened to create
8225
8225
an [=async iterator=]. The [=async iterator=] can be asynchronously iterated over to produce values.
8226
8226
8227
8227
<dfn lt="async iterator" export>Async iterators</dfn> are [=structs=] with the following [=struct/items=]:
@@ -8230,12 +8230,12 @@ an [=async iterator=]. The [=async iterator=] can be asynchronously iterated ove
8230
8230
8231
8231
<div algorithm>
8232
8232
8233
- To <dfn id="async-iterable -open" export lt="open an async iterable ">open</dfn> an
8234
- <code><a lt="async iterable type">async iterable <<var>T</var>></a></code> |iterable |:
8233
+ To <dfn id="async-sequence -open" export lt="open an async sequence ">open</dfn> an
8234
+ <code><a lt="async sequence type">async_sequence <<var>T</var>></a></code> |sequence |:
8235
8235
8236
- 1. Let |iterator| be [=?=] <a abstract-op>GetIteratorFromMethod</a>(|iterable |'s
8237
- [=JS async iterable /object=], |iterable |'s [=JS async iterable /method=]).
8238
- 1. If |iterable |'s [=JS async iterable /type=] is "<code>sync</code>", set |iterator| to
8236
+ 1. Let |iterator| be [=?=] <a abstract-op>GetIteratorFromMethod</a>(|sequence |'s
8237
+ [=JS async sequence /object=], |sequence |'s [=JS async sequence /method=]).
8238
+ 1. If |sequence |'s [=JS async sequence /type=] is "<code>sync</code>", set |iterator| to
8239
8239
<a abstract-op>CreateAsyncFromSyncIterator</a>(|iterator|).
8240
8240
1. Return an [=async iterator=] value with [=JS async iterator/underlying record=] set to |iterator| and
8241
8241
[=JS async iterator/type parameter=] set to |T|.
@@ -8294,28 +8294,28 @@ an [=async iterator=]. The [=async iterator=] can be asynchronously iterated ove
8294
8294
8295
8295
</div>
8296
8296
8297
- <div class="example" id="example-js-async-iterable ">
8297
+ <div class="example" id="example-js-async-sequence ">
8298
8298
8299
8299
<code>concatN</code> is an [=operation=] that returns a promise that will be fulfilled with the
8300
- concatenation of all the strings yielded by the async iterable passed to it. It stops
8301
- concatenating and closes the iterator once the async iterable has yielded <var ignore>maxN</var>
8300
+ concatenation of all the strings yielded by the async sequence passed to it. It stops
8301
+ concatenating and closes the iterator once the async sequence has yielded <var ignore>maxN</var>
8302
8302
strings.
8303
8303
8304
8304
<pre>
8305
8305
interface I {
8306
- Promise<DOMString> concatN(async iterable <DOMString> strings, unsigned long maxN);
8306
+ Promise<DOMString> concatN(async_sequence <DOMString> strings, unsigned long maxN);
8307
8307
};
8308
8308
</pre>
8309
8309
8310
8310
<div algorithm="concatN">
8311
8311
8312
- The <code>concatN(|iterable |, |maxN|)</code> method steps are:
8312
+ The <code>concatN(|sequence |, |maxN|)</code> method steps are:
8313
8313
8314
8314
1. Let |promise| be [=a new promise=].
8315
8315
1. Let |result| be the empty string.
8316
8316
1. Let |n| be 0.
8317
- 1. Let |iterator| be the result of <a lt="open an async iterable ">opening</a> |iterable |.
8318
- 1. Let |step| be a sequence of steps that will be used to process the async iterable :
8317
+ 1. Let |iterator| be the result of <a lt="open an async sequence ">opening</a> |sequence |.
8318
+ 1. Let |step| be a sequence of steps that will be used to process the async sequence :
8319
8319
1. Let |next| be the result of <a lt="get an async iterator next value">getting the next value</a> of |iterator|.
8320
8320
1. [=React=] to |next|:
8321
8321
- If |next| was fulfilled with value |v|:
@@ -8906,18 +8906,18 @@ that correspond to the union's [=member types=].
8906
8906
1. If |types| includes {{object}}, then return the IDL value
8907
8907
that is a reference to the object |V|.
8908
8908
1. If |V| [=is an Object=], then:
8909
- 1. If |types| includes an [=async iterable type=], then
8909
+ 1. If |types| includes an [=async sequence type=], then
8910
8910
1. If |types| does not include a [=string type=] or |V| does not have a \[[StringData]] [=/internal slot=], then
8911
8911
1. Let |asyncMethod| be [=?=] <a abstract-op>GetMethod</a>(|V|, {{%Symbol.asyncIterator%}}).
8912
8912
1. If |asyncMethod| is not <emu-val>undefined</emu-val>,
8913
- return an IDL [=async iterable =] value with [=JS async iterable /object=]
8914
- set to |V|, [=JS async iterable /method=] set to |syncMethod|, and
8915
- [=JS async iterable /type=] set to "<code>async</code>".
8913
+ return an IDL [=async sequence =] value with [=JS async sequence /object=]
8914
+ set to |V|, [=JS async sequence /method=] set to |syncMethod|, and
8915
+ [=JS async sequence /type=] set to "<code>async</code>".
8916
8916
1. Let |syncMethod| be [=?=] <a abstract-op>GetMethod</a>(|V|, {{%Symbol.iterator%}}).
8917
8917
1. If |syncMethod| is not <emu-val>undefined</emu-val>,
8918
- return an IDL [=async iterable =] value with [=JS async iterable /object=]
8919
- set to |V|, [=JS async iterable /method=] set to |syncMethod|, and
8920
- [=JS async iterable /type=] set to "<code>sync</code>".
8918
+ return an IDL [=async sequence =] value with [=JS async sequence /object=]
8919
+ set to |V|, [=JS async sequence /method=] set to |syncMethod|, and
8920
+ [=JS async sequence /type=] set to "<code>sync</code>".
8921
8921
1. If |types| includes a [=sequence type=], then
8922
8922
1. Let |method| be [=?=] <a abstract-op>GetMethod</a>(|V|, {{%Symbol.iterator%}}).
8923
8923
1. If |method| is not <emu-val>undefined</emu-val>,
@@ -11492,7 +11492,7 @@ Note: The HTML Standard defines how a security check is performed. [[!HTML]]
11492
11492
1. Otherwise: if |V| [=is an Object=] and
11493
11493
there is an entry in |S| that has one of the
11494
11494
following types at position |i| of its type list,
11495
- * an [=async iterable type=]
11495
+ * an [=async sequence type=]
11496
11496
* a [=nullable type|nullable=] version of any of the above types
11497
11497
* an [=annotated type=] whose [=annotated types/inner type=] is one of the above types
11498
11498
* a [=union type=], [=nullable type|nullable=] union type, or [=annotated type|annotated=] union type
@@ -11682,7 +11682,7 @@ Note: The HTML Standard defines how a security check is performed. [[!HTML]]
11682
11682
Generally, the inspection of the value at the distinguishing argument index does not have any
11683
11683
side effects, and the only side effects in the overload resolution algorithm are the result of
11684
11684
converting the JavaScript values to IDL values.
11685
- (An exception exists when one of the overloads has an [=async iterable type=], [=sequence type=]
11685
+ (An exception exists when one of the overloads has an [=async sequence type=], [=sequence type=]
11686
11686
or [=frozen array type=] at the distinguishing argument index.
11687
11687
In this case, we attempt to get the {{%Symbol.asyncIterator%}} / {{%Symbol.iterator%}} property
11688
11688
to determine the appropriate overload, and perform the conversion of the distinguishing argument
0 commit comments