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

    r61732 r62727  
    254254        ASSERT(name);
    255255        PropertyNode::Type type;
    256         if (*getOrSet == "get")
     256        if (*getOrSet == m_globalData->propertyNames->get)
    257257            type = PropertyNode::Getter;
    258         else if (*getOrSet == "set")
     258        else if (*getOrSet == m_globalData->propertyNames->set)
    259259            type = PropertyNode::Setter;
    260260        else
Note: See TracChangeset for help on using the changeset viewer.