<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body><span class="vcard"><a class="email" href="mailto:gskachkov&#64;gmail.com" title="GSkachkov &lt;gskachkov&#64;gmail.com&gt;"> <span class="fn">GSkachkov</span></a>
</span> changed
              <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [ES6] Implement ES6 arrow function syntax. Parser of arrow function with execution as common function"
   href="https://bugs.webkit.org/show_bug.cgi?id=144955">bug 144955</a>
        <br>
             <table border="1" cellspacing="0" cellpadding="8">
          <tr>
            <th>What</th>
            <th>Removed</th>
            <th>Added</th>
          </tr>

         <tr>
           <td style="text-align:right;">Attachment #255191 is obsolete</td>
           <td>1
           </td>
           <td>
               &nbsp;
           </td>
         </tr></table>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [ES6] Implement ES6 arrow function syntax. Parser of arrow function with execution as common function"
   href="https://bugs.webkit.org/show_bug.cgi?id=144955#c70">Comment # 70</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [ES6] Implement ES6 arrow function syntax. Parser of arrow function with execution as common function"
   href="https://bugs.webkit.org/show_bug.cgi?id=144955">bug 144955</a>
              from <span class="vcard"><a class="email" href="mailto:gskachkov&#64;gmail.com" title="GSkachkov &lt;gskachkov&#64;gmail.com&gt;"> <span class="fn">GSkachkov</span></a>
</span></b>
        <pre>Comment on <span class=""><a href="attachment.cgi?id=255191&amp;action=diff" name="attach_255191" title="Patch">attachment 255191</a> <a href="attachment.cgi?id=255191&amp;action=edit" title="Patch">[details]</a></span>
Patch

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

<span class="quote">&gt;&gt; Source/JavaScriptCore/ChangeLog:106
&gt;&gt; +        (JSC::SyntaxChecker::setFunctionNameStart):
&gt; 
&gt; Ah, when using `Tools/Scripts/webkit-patch upload --update-changelogs` and the ChangeLog is significantly different from the previous version, it appends new logs.
&gt; So let's drop the previous one manually.</span >

Done

<span class="quote">&gt;&gt; Source/JavaScriptCore/parser/Parser.cpp:1270
&gt;&gt; +        result = parseArrowFunctionExpression(context, parseType);
&gt; 
&gt; Saam's pointing is reasonable. Could you rename it to &quot;parseArrowFunctionSingleExpressionBody&quot;?</span >

Done.

<span class="quote">&gt;&gt; Source/JavaScriptCore/parser/Parser.cpp:1447
&gt;&gt; +    bool isClassConstructor;
&gt; 
&gt; Let's drop this line.</span >

Done

<span class="quote">&gt;&gt; Source/JavaScriptCore/parser/Parser.cpp:1472
&gt;&gt; +        isClassConstructor = mode == MethodMode &amp;&amp; info.name &amp;&amp; *info.name == m_vm-&gt;propertyNames-&gt;constructor;
&gt; 
&gt; It seems this line is not necessary, right?</span >

Done

<span class="quote">&gt;&gt; Source/JavaScriptCore/parser/Parser.cpp:1478
&gt;&gt; +        isClassConstructor = constructorKind != ConstructorKind::None;
&gt; 
&gt; This always override the previous one. And I think this line is not necessary.</span >

Done

<span class="quote">&gt;&gt; Source/JavaScriptCore/parser/Parser.cpp:1487
&gt;&gt; +        isClassConstructor = false;
&gt; 
&gt; I think this line is not necessary. Instead, let's insert `ASSERT(constructorKind == ConstructorKind::None);` (correct?)</span >

Done

<span class="quote">&gt;&gt; Source/JavaScriptCore/parser/Parser.cpp:1495
&gt;&gt; +    constructorKind = isClassConstructor ? constructorKind : ConstructorKind::None;
&gt; 
&gt; I think this line is not necessary.</span >

Done

<span class="quote">&gt;&gt; Source/JavaScriptCore/parser/Parser.cpp:1610
&gt;&gt; +        info.isEndByTerminator = true;
&gt; 
&gt; OK, they are initialized in struct definition with C++11 initialization form.</span >

Done

<span class="quote">&gt;&gt; Source/JavaScriptCore/parser/Parser.cpp:1635
&gt;&gt; +            parameters.isPrevTerminator = m_lexer-&gt;prevTerminator();
&gt; 
&gt; These fields are not initialized if parseType is not ArrowFunctionParseType.
&gt; Since they are primimtive types (unsigned int etc.), use of uninitialized values causes undefined behavior in C++.
&gt; 
&gt; Let's take the either way
&gt; 1. initialize them in the struct definition with C++11 initialization form.
&gt; 2. initialize them before this if-branch.</span >

So I've added initializing of this paramters in the struct definition

<span class="quote">&gt;&gt; Source/JavaScriptCore/parser/ParserFunctionInfo.h:41
&gt;&gt; +    unsigned startFunctionOffset = 0;
&gt; 
&gt; Let's exchange this member's order.
&gt;     unsigned startFunctionOffset = 0;
&gt;     unsigned endFunctionOffset = 0;</span >

Done

<span class="quote">&gt;&gt; Source/JavaScriptCore/parser/ParserFunctionInfo.h:49
&gt;&gt; +    FunctionBodyType functionBodyType = StandardFunctionBodyBlock;
&gt; 
&gt; They are initialized with C++ initialization form.</span >

Done

<span class="quote">&gt;&gt; Source/JavaScriptCore/parser/SourceProviderCacheItem.h:39
&gt;&gt; +    unsigned endFunctionOffset;
&gt; 
&gt; Since now we have endFunctionEndOffset, endFunctionStartOffset sounds better.</span >

Done

<span class="quote">&gt;&gt; Source/JavaScriptCore/parser/SourceProviderCacheItem.h:50
&gt;&gt; +    bool isPrevTerminator;
&gt; 
&gt; Since the above 3 fields not set if the function is standard function, it becomes undefined values in C++.
&gt; Let's use C++11 initialization.
&gt; 
&gt;     bool isBodyArrowExpression { false };
&gt;     JSTokenType tokenType { CLOSEBRACE };
&gt;     bool isPrevTerminator { false };</span >

Done</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>