Re: [heycam/webidl] Allow async iterators to specify return algorithms (#805)

domenic commented on this pull request.



> +        *   the platform object |object|,
+        *   the identifier "<code>return</code>", and
+        *   the type "<code>method</code>".
+
+        If this threw an exception |e|, then:
+        1.  Perform [=!=] [$Call$](|returnPromiseCapability|.\[[Reject]],
+            <emu-val>undefined</emu-val>, « |e| »).
+        1.  Return |returnPromiseCapability|.\[[Promise]].
+
+    1.  If |object| is not a [=default asynchronous iterator object=] for |interface|, then:
+        1.  Let |error| be a new {{ECMAScript/TypeError}}.
+        1.  Perform [=!=] [$Call$](|returnPromiseCapability|.\[[Reject]],
+            <emu-val>undefined</emu-val>, « |error| »).
+        1.  Return |returnPromiseCapability|.\[[Promise]].
+
+    1.  If |object|'s [=default asynchronous iterator object/ongoing promise=] is not undefined, then:

Mmm nice catch. Since we made it an IDL Promise, we should probably union it with null (another IDL value), not undefined (which is always `<emu-val>undefined</emu-val>`, a JS value). I switched all instances to do so.

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

Received on Wednesday, 16 October 2019 11:03:12 UTC