<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [JSC] implement async functions proposal"
   href="https://bugs.webkit.org/show_bug.cgi?id=156147#c80">Comment # 80</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [JSC] implement async functions proposal"
   href="https://bugs.webkit.org/show_bug.cgi?id=156147">bug 156147</a>
              from <span class="vcard"><a class="email" href="mailto:utatane.tea&#64;gmail.com" title="Yusuke Suzuki &lt;utatane.tea&#64;gmail.com&gt;"> <span class="fn">Yusuke Suzuki</span></a>
</span></b>
        <pre>Comment on <span class=""><a href="attachment.cgi?id=278692&amp;action=diff" name="attach_278692" title="Patch">attachment 278692</a> <a href="attachment.cgi?id=278692&amp;action=edit" title="Patch">[details]</a></span>
Patch

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

Nice clean up! Sorry for my late review process. I have a time on week end :)

<span class="quote">&gt; Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp:245
&gt; +    bool containsArrowOrEvalButNotInArrowBlock = ((functionNode-&gt;usesArrowFunction() &amp;&amp; functionNode-&gt;doAnyInnerArrowFunctionsUseAnyFeature()) || functionNode-&gt;usesEval()) &amp;&amp; (!m_codeBlock-&gt;isArrowFunction() &amp;&amp; !m_codeBlock-&gt;isAsyncArrowFunction());</span >

Now, isArrowFunction() includes isAsyncArrowFunction, let's drop isAsyncArrowFunction. :)

<span class="quote">&gt; Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp:249
&gt; +    bool needsArguments = (functionNode-&gt;usesArguments() || codeBlock-&gt;usesEval() || (functionNode-&gt;usesArrowFunction() &amp;&amp; !codeBlock-&gt;isArrowFunction() &amp;&amp; !codeBlock-&gt;isAsyncArrowFunction() &amp;&amp; isArgumentsUsedInInnerArrowFunction()));</span >

Ditto.

<span class="quote">&gt; Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp:509
&gt; +        if (!haveParameterNamedArguments &amp;&amp; !m_codeBlock-&gt;isArrowFunction() &amp;&amp; !m_codeBlock-&gt;isAsyncArrowFunction()) {</span >

isAsyncArrowFunction is included in isArrowFunction().

<span class="quote">&gt; Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp:630
&gt; +    if (SourceParseMode::ArrowFunctionMode == parseMode || SourceParseMode::AsyncArrowFunctionBodyMode == parseMode || SourceParseMode::AsyncArrowFunctionMode == parseMode) {</span >

Is this AsyncArrowFunctionBodyMode correct?

<span class="quote">&gt; Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp:638
&gt; +    if (needsToUpdateArrowFunctionContext() &amp;&amp; !codeBlock-&gt;isArrowFunction() &amp;&amp; !codeBlock-&gt;isAsyncArrowFunction()) {</span >

isAsyncArrowFunction is included in isArrowFunction()

<span class="quote">&gt; Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp:4313
&gt; +    ASSERT(m_codeBlock-&gt;isArrowFunction() || parseMode() == SourceParseMode::AsyncArrowFunctionBodyMode || parseMode() == SourceParseMode::AsyncArrowFunctionMode || m_codeBlock-&gt;isArrowFunctionContext() || constructorKind() == ConstructorKind::Derived || m_codeType == EvalCode);</span >

Is this `SourceParseMode::AsyncArrowFunctionBodyMode` correct?

<span class="quote">&gt; Source/JavaScriptCore/parser/ASTBuilder.h:386
&gt; +            usesArrowFunction();</span >

Is this usesArrowFunction() here correct?

<span class="quote">&gt; Source/JavaScriptCore/parser/Parser.cpp:3562
&gt; +            goto parseProperty;</span >

Is it safe for `async hello: value` property?

<span class="quote">&gt; Source/JavaScriptCore/parser/Parser.cpp:3989
&gt; +            return parseAsyncFunctionExpression(context);</span >

Looks nice.

<span class="quote">&gt; Source/JavaScriptCore/parser/Parser.h:1579
&gt; +        ASSERT(false);</span >

Let's use `RELEASE_ASSERT_NOT_REACHED()`

<span class="quote">&gt; Source/JavaScriptCore/runtime/CodeCache.cpp:200
&gt; +    ConstructAbility constructAbility = constructAbilityForParseMode(metadata-&gt;parseMode());</span >

Nice.</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>