<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@gmail.com" title="GSkachkov <gskachkov@gmail.com>"> <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">> 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->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).</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>