[Webkit-unassigned] [Bug 148148] Function.prototype.toString is incorrect for ArrowFunction

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Aug 25 04:46:51 PDT 2015


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

--- Comment #10 from GSkachkov <gskachkov at gmail.com> ---
Comment on attachment 259404
  --> https://bugs.webkit.org/attachment.cgi?id=259404
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=259404&action=review

>> 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"

Done

>> 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)

I've added more tests, check in LayoutTests/js/script-tests/arrowfunction-tostring.js is it enough.

-- 
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/20150825/cd716f54/attachment.html>


More information about the webkit-unassigned mailing list