<html>
<head>
<base href="https://bugs.webkit.org/" />
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - [ES6] Implement ES6 arrow function syntax. Parser of arrow function with execution as common function"
href="https://bugs.webkit.org/show_bug.cgi?id=144955#c20">Comment # 20</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - [ES6] Implement ES6 arrow function syntax. Parser of arrow function with execution as common function"
href="https://bugs.webkit.org/show_bug.cgi?id=144955">bug 144955</a>
from <span class="vcard"><a class="email" href="mailto:gskachkov@gmail.com" title="GSkachkov <gskachkov@gmail.com>"> <span class="fn">GSkachkov</span></a>
</span></b>
<pre>(In reply to <a href="show_bug.cgi?id=144955#c17">comment #17</a>)
<span class="quote">> Comment on <span class="bz_obsolete"><a href="attachment.cgi?id=253195&action=diff" name="attach_253195" title="Patch">attachment 253195</a> <a href="attachment.cgi?id=253195&action=edit" title="Patch">[details]</a></span>
> Patch
>
> View in context:
> <a href="https://bugs.webkit.org/attachment.cgi?id=253195&action=review">https://bugs.webkit.org/attachment.cgi?id=253195&action=review</a>
>
> >>>>> 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 <a href="https://github.com/WebKit/webkit/blob/master/Source/JavaScriptCore/parser/Parser.cpp#L1426">https://github.com/WebKit/webkit/blob/master/Source/JavaScriptCore/parser/Parser.cpp#L1426</a>
> >
> > 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 <a class="bz_bug_link
bz_status_NEW "
title="NEW - [ES6] Implement ES6 arrow function syntax. Arrow function specific features. Lexical bind of this"
href="show_bug.cgi?id=144956">https://bugs.webkit.org/show_bug.cgi?id=144956</a>,
> > also I've add new one        <a class="bz_bug_link
bz_status_NEW "
title="NEW - [ES6] Arrow function syntax. Arrow function specific features. Lexical bind "arguments", "super", "new.target""
href="show_bug.cgi?id=145132">https://bugs.webkit.org/show_bug.cgi?id=145132</a> 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.</span >
I've checked it seems that this statement is unnecessary. So I've removed it. Tests are still green.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>