<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [ESNext] Async iteration - Implement Async Generator"
   href="https://bugs.webkit.org/show_bug.cgi?id=166695#c2">Comment # 2</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [ESNext] Async iteration - Implement Async Generator"
   href="https://bugs.webkit.org/show_bug.cgi?id=166695">bug 166695</a>
              from <span class="vcard"><a class="email" href="mailto:caitp&#64;igalia.com" title="Caitlin Potter (:caitp) &lt;caitp&#64;igalia.com&gt;"> <span class="fn">Caitlin Potter (:caitp)</span></a>
</span></b>
        <pre>Comment on <span class=""><a href="attachment.cgi?id=298142&amp;action=diff" name="attach_298142" title="Patch">attachment 298142</a> <a href="attachment.cgi?id=298142&amp;action=edit" title="Patch">[details]</a></span>
Patch

View in context: <a href="https://bugs.webkit.org/attachment.cgi?id=298142&amp;action=review">https://bugs.webkit.org/attachment.cgi?id=298142&amp;action=review</a>

Cool stuff so far. I'd like to look at this more on Friday.

<span class="quote">&gt; Source/JavaScriptCore/builtins/AsyncGeneratorPrototype.js:39
&gt; +        &#64;throwTypeError(&quot;Async generator is executing&quot;);</span >

Async Generators differ from ordinary generators, in that it's not an error to resume the generator while it's executing.

While it's an unlikely case, the generator is allowed to queue up additional requests while executing, and the queue of requests is drained during resumption (the proposal words this as recursive calls from AsyncGeneratorResolve / AsyncGeneratorReject -&gt; AsyncGeneratorResumeNext)

<span class="quote">&gt; Source/JavaScriptCore/builtins/AsyncGeneratorPrototype.js:65
&gt; +    if (generator.&#64;asyncGeneratorState === &#64;AsyncGeneratorStateAwait) {</span >

the special generator continuation is a nice idea.

Though it doesn't affect JSC just yet due to not being implemented, note that this would _probably_ be observable via the function.sent metaproperty (or at least, it is in the v8 generator implementation without some additional work).</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>