[Webkit-unassigned] [Bug 144955] [ES6] Implement ES6 arrow function syntax. Parser of arrow function with execution as common function

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Jun 25 16:33:00 PDT 2015


--- Comment #88 from GSkachkov <gskachkov at gmail.com> ---
(In reply to comment #82)
> 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).

I've tried to implement most of your suggestion in last patch. Please take a look if it code is better

You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20150625/9fef14dc/attachment-0001.html>

More information about the webkit-unassigned mailing list