Ignore:
Timestamp:
Jul 7, 2010, 4:27:57 PM (15 years ago)
Author:
[email protected]
Message:

2010-07-07 Oliver Hunt <[email protected]>

Reviewed by Geoffrey Garen.

Lazy mode of parser allows invalid syntax in object literals.
https://bugs.webkit.org/show_bug.cgi?id=41809

Make the parser itself validate getter and setter syntax rather
than offloading it to the AST builder.

  • parser/ASTBuilder.h: (JSC::ASTBuilder::createGetterOrSetterProperty):
  • parser/JSParser.cpp: (JSC::JSParser::parseProperty):
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/parser/JSParser.cpp

    r61878 r62727  
    11691169        int closeBracePos = 0;
    11701170        int bodyStartLine = 0;
     1171        failIfFalse(*ident == m_globalData->propertyNames->get || *ident == m_globalData->propertyNames->set);
    11711172        failIfFalse(parseFunctionInfo<FunctionNeedsName>(context, accessorName, parameters, body, openBracePos, closeBracePos, bodyStartLine));
    11721173        return context.createGetterOrSetterProperty(ident, accessorName, parameters, body, openBracePos, closeBracePos, bodyStartLine, m_lastLine);
Note: See TracChangeset for help on using the changeset viewer.