[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
Fri Jun 12 06:52:59 PDT 2015


https://bugs.webkit.org/show_bug.cgi?id=144955

--- Comment #59 from Saam Barati <saambarati1 at gmail.com> ---
(In reply to comment #58)
> Comment on attachment 254445 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=254445&action=review
> 
> >> Source/JavaScriptCore/parser/Parser.cpp:607
> >> +    bool correctArrowFinish = isEndOfArrowFunction() || match(EOFTOK);
> > 
> > `match(EOFTOK)` is contained in `isEndOfArrowFunction()`. So I think `match(EOFTOK)` is not needed. Correct?
> > If so, we can change it to `failIfFalse(isEndOfArrowFunction(), "...");` by merging the following check.
> 
> Done
> 
> >> Source/JavaScriptCore/parser/Parser.cpp:608
> >> +    failIfFalse(correctArrowFinish, "Expected a ';', ']', '}', ')', or ',' following a arrow function statement");
> > 
> > it seems refering to EOF and Line terminator is needed.
> 
> Done
> 
> >> Source/JavaScriptCore/parser/Parser.cpp:1257
> >> +        result = parseArrowFunctionStatement(context, parseType);
> > 
> > This `parseArrowFunctionStatement` name confuses me.
> > This function is used when
> > 
> > (e) `=> expr;`
> > 
> > part, right? If so, I think clearer name is encouraged.
> 
> I've renamed it to parseArrowFunctionExpression.
Is this only used when parsing the sinle expression in the body syntax?
(If not, ignore the below.)
If so, I think this is a bad name. To me it sounds like the function
is named as if it's parsing the entire arrow function as an expression.
I'd be more verbose and go with a name like "parseArrowFunctionSingleExpressionBody"
or something else that indicates what the function is doing without any ambiguity.

-- 
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/20150612/826a4e9c/attachment.html>


More information about the webkit-unassigned mailing list