<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body>
      <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#c88">Comment # 88</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>(In reply to <a href="show_bug.cgi?id=144955#c82">comment #82</a>)
<span class="quote">&gt; Hm, I think modifying index (like endArrowFunction + 1) is not good since it
&gt; leads heap overrun easily.
&gt; 
&gt; So I suggest the following change, GSkachkov, what do you think about it?
&gt; 
&gt; 1. info.endFunctionOffset is stored independently from the lastToken
&gt; information. When cacheInfo is hit, just set info.endFunctionOffset =
&gt; cachedInfo-&gt;endFunctionOffset. Not recalculate it.
&gt; 
&gt; 2. cachedInfo (and param) has lastToken information. Change
&gt; endFunctionStartOffset etc. to lastTokenStartOffset etc. And
&gt; endFunctionToken is generated from this information.
&gt; 
&gt; 3. Store the last token information to cacheInfo. Don't separate pathes for
&gt; Arrow+Expr, Arrow+Block and Standard. In all cases, just store the last
&gt; token. And info.endFunctionOffset is adjusted only in ArrowExpr case
&gt; (lastToken.endOffset). In the other case, use lastToken.startOffset as
&gt; info.endFunctionOffset. And when using cachedInfo, just set stored token and
&gt; call `next()` in all cases.
&gt; 
&gt; 4. Not containing the arrow function expression body's terminator token
&gt; (like ';') in function code. `next()` in reparsing phase in SingleExpression
&gt; parsing is removed.
&gt; 
&gt; This drops many if-defs, simplifies the code and avoids index modification
&gt; (like endxxx + 1).</span >

I've tried to implement most of your suggestion in last patch. Please take a look if it code is better</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>