[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
Tue May 19 04:23:37 PDT 2015


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

--- Comment #20 from GSkachkov <gskachkov at gmail.com> ---
(In reply to comment #17)
> Comment on attachment 253195 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=253195&action=review
> 
> >>>>> Source/JavaScriptCore/parser/Parser.cpp:1203
> >>>>> +            context.setEndOffset(result, m_lastTokenEndPosition.offset);
> >>>> 
> >>>> What is this setEndOffset for?
> >>> 
> >>> Actually, this is wrong. How does this code not segfault?
> >>> setEndOffset is meant to be called with non-null AST nodes
> >> 
> >> Hmm, I run this method to set correct ending of the block for arrow function with expression for instance var f = x => x + 10; 
> >> Where ';' is used as end of the statement var f...; and end of arrow function x=>x+10;
> >> For the same purpose as in this method https://github.com/WebKit/webkit/blob/master/Source/JavaScriptCore/parser/Parser.cpp#L1426
> > 
> > As for now I've created issue where is implemented lexical bind of 'this' and raising exception in case of trying use arrow function with new https://bugs.webkit.org/show_bug.cgi?id=144956, 
> > also I've add new one	https://bugs.webkit.org/show_bug.cgi?id=145132 and will add one more later.
> 
> Right. But, if you look at the code for setEndOffset, it will deference the
> AST node you pass it (inside ASTBuilder, not SyntaxChecker).
> This will be bad because we're passing in null for that AST node.
> 
> On another note, this code path seems a little bit weird to me. Is there an
> alternate
> way to check the end of an arrow function that isn't inside parseStatement? 
> To me, this seems like a weird place for this code to live.

I've checked it seems that this statement is unnecessary. So I've removed it. Tests are still green.

-- 
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/20150519/e87d4e03/attachment.html>


More information about the webkit-unassigned mailing list