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

@lucacasonato commented on this pull request.



> +In the JavaScript binding, IDL [=async iterable type|async iterable=] values are represented by
+a [=struct=] with the following [=struct/items=]:
+
+* <dfn for="JS async iterable">object</dfn>, a JavaScript value
+* <dfn for="JS async iterable">method</dfn>, a JavaScript value
+* <dfn for="JS async iterable">type</dfn>, either "<code>sync</code>" or "<code>async</code>"
+
+
+<div id="js-to-async-iterable" algorithm="convert a JavaScript value to async iterable">
+    A JavaScript value |V| is [=converted to an IDL value|converted=]
+    to an IDL <a lt="async iterable">async iterable&lt;<var ignore>T</var>&gt;</a> value as follows:
+
+    1.  If |V| [=is not an Object=], then
+        [=JavaScript/throw=] a <l spec=ecmascript>{{TypeError}}</l>.
+    1.  Let |method| be [=?=] <a abstract-op>GetMethod</a>(obj, {{%Symbol.asyncIterator%}}).
+    1.  If |method| is undefined:

```suggestion
    1.  If |method| is <emu-val>undefined</emu-val>:
```

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

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

Received on Saturday, 25 January 2025 21:52:49 UTC