Ignore:
Timestamp:
Jul 19, 2015, 12:31:36 PM (10 years ago)
Author:
[email protected]
Message:

Parser::parseFunctionInfo hits RELEASE_ASSERT for Arrow Functions
https://bugs.webkit.org/show_bug.cgi?id=147090

Reviewed by Yusuke Suzuki.

Source/JavaScriptCore:

ArrowFunction's have there ParserFunctionInfo "name" field to
be a non-null pointer. This is obviously allowed and valid except we
had a RELEASE_ASSERT that claimed otherwise. This is a mistake.

Note: ArrowFunction's will never actually have a function name;
there ParserFunctionInfo "name" field will be the empty string.
This is not be mistaken with the name field being a null pointer.

  • parser/Parser.cpp:

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

LayoutTests:

  • js/arrowfunction-strict-mode-expected.txt: Added.
  • js/arrowfunction-strict-mode.html: Added.
  • js/script-tests/arrowfunction-strict-mode.js: Added.

(foo):

File:
1 edited

Legend:

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

    r187012 r187014  
    17151715    context.setEndOffset(functionInfo.body, m_lexer->currentOffset());
    17161716    if (functionScope->strictMode() && functionInfo.name) {
    1717         RELEASE_ASSERT(mode == NormalFunctionMode || mode == MethodMode);
     1717        RELEASE_ASSERT(mode == NormalFunctionMode || mode == MethodMode || mode == ArrowFunctionMode);
    17181718        semanticFailIfTrue(m_vm->propertyNames->arguments == *functionInfo.name, "'", functionInfo.name->impl(), "' is not a valid function name in strict mode");
    17191719        semanticFailIfTrue(m_vm->propertyNames->eval == *functionInfo.name, "'", functionInfo.name->impl(), "' is not a valid function name in strict mode");
Note: See TracChangeset for help on using the changeset viewer.