<html>
<head>
<base href="https://bugs.webkit.org/" />
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - Function.prototype.toString is incorrect for ArrowFunction"
href="https://bugs.webkit.org/show_bug.cgi?id=148148#c10">Comment # 10</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - Function.prototype.toString is incorrect for ArrowFunction"
href="https://bugs.webkit.org/show_bug.cgi?id=148148">bug 148148</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>Comment on <span class="bz_obsolete"><a href="attachment.cgi?id=259404&action=diff" name="attach_259404" title="Patch">attachment 259404</a> <a href="attachment.cgi?id=259404&action=edit" title="Patch">[details]</a></span>
Patch
View in context: <a href="https://bugs.webkit.org/attachment.cgi?id=259404&action=review">https://bugs.webkit.org/attachment.cgi?id=259404&action=review</a>
<span class="quote">>> Source/JavaScriptCore/parser/ASTBuilder.h:375
>> + SourceCode source = m_sourceCode->subExpression(functionInfo.startOffset, functionInfo.body->isArrowFunctionBodyExpression() ? functionInfo.endOffset -1 : functionInfo.endOffset, functionInfo.startLine, functionInfo.bodyStartColumn);
>
> Nit: space between "-" and "1"</span >
Done
<span class="quote">>> Source/JavaScriptCore/parser/ASTBuilder.h:376
>> ArrowFuncExprNode* result = new (m_parserArena) ArrowFuncExprNode(location, *functionInfo.name, functionInfo.body, source);
>
> The - 1 worries me.
> Does this work:
> function foo(x) { print(x.toString() }
> foo((y)=>y)</span >
I've added more tests, check in LayoutTests/js/script-tests/arrowfunction-tostring.js is it enough.</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>