Ignore:
Timestamp:
Aug 25, 2015, 12:10:29 PM (10 years ago)
Author:
[email protected]
Message:

Function.prototype.toString is incorrect for ArrowFunction
https://bugs.webkit.org/show_bug.cgi?id=148148

Source/JavaScriptCore:

Patch by Aleksandr Skachkov <[email protected]> on 2015-08-25
Reviewed by Saam Barati.

Added correct support of toString() method for arrow function.

  • parser/ASTBuilder.h:

(JSC::ASTBuilder::createFunctionMetadata):
(JSC::ASTBuilder::createArrowFunctionExpr):

  • parser/Nodes.cpp:

(JSC::FunctionMetadataNode::FunctionMetadataNode):

  • parser/Nodes.h:
  • parser/Parser.cpp:

(JSC::Parser<LexerType>::parseFunctionBody):
(JSC::Parser<LexerType>::parseFunctionInfo):

  • parser/SyntaxChecker.h:

(JSC::SyntaxChecker::createFunctionMetadata):

  • runtime/FunctionPrototype.cpp:

(JSC::functionProtoFuncToString):

  • tests/stress/arrowfunction-tostring.js: Added.

LayoutTests:

Patch by Skachkov Oleksandr <[email protected]> on 2015-08-25
Reviewed by Saam Barati.

Added test of toString() method.

  • js/arrowfunction-tostring-expected.txt: Added.
  • js/arrowfunction-tostring.html: Added.
  • js/script-tests/arrowfunction-tostring.js: Added.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/parser/Nodes.cpp

    r188545 r188928  
    152152    const JSTokenLocation& endLocation, unsigned startColumn, unsigned endColumn,
    153153    int functionKeywordStart, int functionNameStart, int parametersStart, bool isInStrictContext,
    154     ConstructorKind constructorKind, unsigned parameterCount, SourceParseMode mode, bool isArrowFunction)
     154    ConstructorKind constructorKind, unsigned parameterCount, SourceParseMode mode, bool isArrowFunction, bool isArrowFunctionBodyExpression)
    155155        : Node(endLocation)
    156156        , m_startColumn(startColumn)
     
    165165        , m_constructorKind(static_cast<unsigned>(constructorKind))
    166166        , m_isArrowFunction(isArrowFunction)
     167        , m_isArrowFunctionBodyExpression(isArrowFunctionBodyExpression)
    167168{
    168169    ASSERT(m_constructorKind == static_cast<unsigned>(constructorKind));
Note: See TracChangeset for help on using the changeset viewer.