Re: [heycam/webidl] Make async iterator return() function after failed next (#891)

@domenic commented on this pull request.



> @@ -12543,8 +12543,13 @@ The \[[Prototype]] [=internal slot=] of an [=asynchronous iterator prototype obj
                 1.  Let |value| be |next|, [=converted to an ECMAScript value=].
                 1.  Return [=!=] [$CreateIterResultObject$](|value|, <emu-val>false</emu-val>).
         1.  Let |onFulfilled| be [=!=] [$CreateBuiltinFunction$](|fulfillSteps|, « »).
-        1.  Perform [=!=] [$PerformPromiseThen$](|nextPromise|, |onFulfilled|,
-            <emu-val>undefined</emu-val>, |nextPromiseCapability|).
+        1.  Let |rejectSteps| be the following steps, given |reason|:
+            1.  Set |object|'s [=default asynchronous iterator object/ongoing promise=] to
+                null.
+            1.  [=ECMAScript/Throw=] |reason|.

I like these ideas, and I will work to align the spec with generators in the way you suggest. It's good that we're getting this review coverage now that these things are being used seriously in specs, and implemented (albeit only implemented in webidl2js so far).

-- 
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/891#discussion_r436118705

Received on Friday, 5 June 2020 19:22:24 UTC