@@ -8162,17 +8162,17 @@ Note: Instead of returning an async iterable from an IDL operation, the operatio
8162
8162
8163
8163
<div algorithm>
8164
8164
8165
- To <dfn id="async-iterable-finish-iterating " export lt="finish iterating an async iterable">finish iterating </dfn> an
8165
+ To <dfn id="async-iterable-close " export lt="close an async iterable">close </dfn> an
8166
8166
<code><a lt="async iterable type">async iterable<<var ignore>T</var>></a></code> |iteratorRecord|,
8167
- perform the following steps:
8167
+ with a reason |reason|, perform the following steps:
8168
8168
8169
8169
1. Let |iterator| be |iteratorRecord|.\[[Iterator]].
8170
8170
1. Let |returnMethod| be <a abstract-op>GetMethod</a>(|iterator|, "return").
8171
8171
1. If |returnMethod| is an abrupt completion, return [=a promise rejected with=]
8172
8172
|returnMethod|.\[[Value]].
8173
8173
1. If |returnMethod| is <emu-val>undefined</emu-val>, return [=a promise resolved with=]
8174
8174
<emu-val>undefined</emu-val>.
8175
- 1. Let |returnResult| be <a abstract-op>Call</a>(|returnMethod|.\[[Value]], |iterator|).
8175
+ 1. Let |returnResult| be <a abstract-op>Call</a>(|returnMethod|.\[[Value]], |iterator|, « |reason| » ).
8176
8176
1. If |returnResult| is an abrupt completion, return [=a promise rejected with=]
8177
8177
|returnResult|.\[[Value]].
8178
8178
1. Let |returnPromise| be [=a promise resolved with=] |returnResult|.\[[Value]].
@@ -8188,7 +8188,7 @@ Note: Instead of returning an async iterable from an IDL operation, the operatio
8188
8188
8189
8189
<code>concatN</code> is an [=operation=] that returns a promise that will be fulfilled with the
8190
8190
concatenation of all the strings yielded by the async iterable passed to it. It stops
8191
- concatenating and finishes the iterator once the async iterable has yielded N strings.
8191
+ concatenating and closes the iterator once the async iterable has yielded N strings.
8192
8192
8193
8193
<pre>
8194
8194
interface I {
@@ -8211,7 +8211,8 @@ Note: Instead of returning an async iterable from an IDL operation, the operatio
8211
8211
1. Set |result| to the result of concatenating |result| and |v|.
8212
8212
1. Set |n| to |n| + 1.
8213
8213
1. If |n| is |maxN|, then:
8214
- 1. Let |finish| be the result of <a lt="finish iterating an async iterable">finishing iterating</a> |iterable|.
8214
+ 1. Let |finish| be the result of <a lt="close an async iterable">closing</a>
8215
+ |iterable| with reason <emu-val>undefined</emu-val>.
8215
8216
1. [=React=] to |finish|:
8216
8217
- If |finish| was fulfilled, [=resolve=] |promise| with |result|.
8217
8218
- If |finish| was rejected with reason |r|, [=reject=] |promise| with |r|.
0 commit comments