<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#c82">Comment # 82</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: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>Hm, I think modifying index (like endArrowFunction + 1) is not good since it leads heap overrun easily.

So I suggest the following change, GSkachkov, what do you think about it?

1. info.endFunctionOffset is stored independently from the lastToken information. When cacheInfo is hit, just set info.endFunctionOffset = cachedInfo-&gt;endFunctionOffset. Not recalculate it.

2. cachedInfo (and param) has lastToken information. Change endFunctionStartOffset etc. to lastTokenStartOffset etc. And endFunctionToken is generated from this information.

3. Store the last token information to cacheInfo. Don't separate pathes for Arrow+Expr, Arrow+Block and Standard. In all cases, just store the last token. And info.endFunctionOffset is adjusted only in ArrowExpr case (lastToken.endOffset). In the other case, use lastToken.startOffset as info.endFunctionOffset. And when using cachedInfo, just set stored token and call `next()` in all cases.

4. Not containing the arrow function expression body's terminator token (like ';') in function code. `next()` in reparsing phase in SingleExpression parsing is removed.

This drops many if-defs, simplifies the code and avoids index modification (like endxxx + 1).</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>