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

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Aug 25 00:18:34 PDT 2015


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

Saam Barati <sbarati at apple.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #259404|review?, commit-queue?      |review+, commit-queue-
              Flags|                            |

--- Comment #7 from Saam Barati <sbarati at apple.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

r=me
Please reupload with fixed Nit and added test cases for arrow function body expressions that don't end in ";" and I will r+/cq+

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

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

-- 
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/96e23b9d/attachment.html>


More information about the webkit-unassigned mailing list