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/SyntaxChecker.h

    r188545 r188928  
    187187#endif
    188188    ExpressionType createFunctionExpr(const JSTokenLocation&, const ParserFunctionInfo<SyntaxChecker>&) { return FunctionExpr; }
    189     int createFunctionMetadata(const JSTokenLocation&, const JSTokenLocation&, int, int, bool, int, int, int, ConstructorKind, unsigned, SourceParseMode, bool) { return FunctionBodyResult; }
     189    int createFunctionMetadata(const JSTokenLocation&, const JSTokenLocation&, int, int, bool, int, int, int, ConstructorKind, unsigned, SourceParseMode, bool, bool) { return FunctionBodyResult; }
    190190    ExpressionType createArrowFunctionExpr(const JSTokenLocation&, const ParserFunctionInfo<SyntaxChecker>&) { return FunctionExpr; }
    191191    void setFunctionNameStart(int, int) { }
Note: See TracChangeset for help on using the changeset viewer.