[Webkit-unassigned] [Bug 146934] [ES6] Arrow function syntax. Arrow function should support the destructuring parameters.
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Thu Jan 14 11:02:49 PST 2016
https://bugs.webkit.org/show_bug.cgi?id=146934
--- Comment #8 from GSkachkov <gskachkov at gmail.com> ---
Comment on attachment 268861
--> https://bugs.webkit.org/attachment.cgi?id=268861
Patch
View in context: https://bugs.webkit.org/attachment.cgi?id=268861&action=review
>> Source/JavaScriptCore/parser/Parser.h:1047
>> + }
>
> This function has some redundancy with the below function, lets just combine
> the necessary bits into the below function.
Merged into one function
>> Source/JavaScriptCore/parser/Parser.h:1049
>> + template <class TreeBuilder> bool isArrowFunctionParamters(TreeBuilder& context)
>
> We don't need to templatize this once we move it to SyntaxChecker (see below).
> Also, this function has been misspelled, lets fix the spelling in this patch:
> "isArrowFunctionParamters" => "isArrowFunctionParameters"
Fixed
>> Source/JavaScriptCore/parser/Parser.h:1057
>> + isArrowFunction = true;
>
> Instead of calling the above function, you
> can just check:
> ```
> if (match(IDENT)) {
> save point create;
> next();
> check if arrow function
> save point restore;
> } else if ....
> ```
Refactored
>> Source/JavaScriptCore/parser/Parser.h:1067
>> + isArrowFunction = parseFormalParameters(context, context.createFormalParameterList(), parametersCount) && consume(CLOSEPAREN) && match(ARROWFUNCTION);
>
> Instead of passing in "context" here, we should create a SyntaxChecker and pass that in.
> That way we're not actually allocating AST nodes that we throw away.
Done
--
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/20160114/1b5228af/attachment-0001.html>
More information about the webkit-unassigned
mailing list