[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 00:44:14 PDT 2015


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

--- Comment #17 from Saam Barati <saambarati1 at gmail.com> ---
Comment on attachment 253195
  --> https://bugs.webkit.org/attachment.cgi?id=253195
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.

-- 
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/2411e621/attachment.html>


More information about the webkit-unassigned mailing list