Re: [whatwg/webidl] Add `async iterable<T>` type to WebIDL (PR #1397)

@lucacasonato commented on this pull request.



> +
+</div>
+
+<div algorithm>
+
+    To <dfn id="async-iterable-finish-iterating" export lt="finish iterating an async iterable">finish iterating</dfn> an
+    <code><a lt="async iterable type">async iterable&lt;<var ignore>T</var>&gt;</a></code> |iteratorRecord|,
+    perform the following steps:
+
+    1.  Let |iterator| be |iteratorRecord|.\[[Iterator]].
+    1.  Let |returnMethod| be <a abstract-op>GetMethod</a>(|iterator|, "return").
+    1.  If |returnMethod| is an abrupt completion, return [=a promise rejected with=]
+        |returnMethod|.\[[Value]].
+    1.  If |returnMethod| is <emu-val>undefined</emu-val>, return [=a promise resolved with=]
+        <emu-val>undefined</emu-val>.
+    1.  Let |returnResult| be <a abstract-op>Call</a>(|returnMethod|.\[[Value]], |iterator|).

Done - will update `ReadableStream.from(asyncIterable)` PR.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/webidl/pull/1397#discussion_r1539186237
You are receiving this because you are subscribed to this thread.

Message ID: <whatwg/webidl/pull/1397/review/1960305067@github.com>

Received on Tuesday, 26 March 2024 13:04:41 UTC