Changeset 62848 in webkit for trunk/JavaScriptCore/parser/Nodes.h


Ignore:
Timestamp:
Jul 8, 2010, 2:54:08 PM (15 years ago)
Author:
[email protected]
Message:

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

Reviewed by Gavin Barraclough.

Make object-literal parsing conformant with the spec.
https://bugs.webkit.org/show_bug.cgi?id=41892

Bring our parsing of object literals into conformance with the ES5 spec.
Basically disallow conflicting accessor vs. normal property definitions
The bulk of this patch is just fiddling to maintain performance.

  • parser/ASTBuilder.h: (JSC::ASTBuilder::createGetterOrSetterProperty): (JSC::ASTBuilder::createProperty): (JSC::ASTBuilder::getName): (JSC::ASTBuilder::getType):
  • parser/JSParser.cpp: (JSC::jsParse): (JSC::JSParser::JSParser): (JSC::JSParser::parseProperty): (JSC::JSParser::parseObjectLiteral): (JSC::JSParser::parseStrictObjectLiteral):
  • parser/JSParser.h:
  • parser/Lexer.cpp: (JSC::Lexer::clear):
  • parser/Lexer.h: (JSC::Lexer::currentOffset): (JSC::Lexer::setOffset): Add logic to allow us to roll the lexer back in the input stream.
  • parser/Nodes.h: (JSC::PropertyNode::): (JSC::PropertyNode::type):
  • parser/Parser.cpp: (JSC::Parser::parse):
  • parser/SourceProvider.h: (JSC::SourceProvider::SourceProvider): (JSC::SourceProvider::isValid): (JSC::SourceProvider::setValid): SourceProvider now records whether the input text has already been validated.
  • parser/SyntaxChecker.h: (JSC::SyntaxChecker::SyntaxChecker): (JSC::SyntaxChecker::Property::Property): (JSC::SyntaxChecker::Property::operator!): (JSC::SyntaxChecker::createProperty): (JSC::SyntaxChecker::createPropertyList): (JSC::SyntaxChecker::createGetterOrSetterProperty): The SyntaxChecker mode now needs to maintain a bit more information to ensure that we can validate object literals correctly.

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

Reviewed by Gavin Barraclough.

Need a short description and bug URL (OOPS!)

  • fast/js/object-literal-syntax-expected.txt: Added.
  • fast/js/object-literal-syntax.html: Added.
  • fast/js/parser-syntax-check-expected.txt:
  • fast/js/script-tests/object-literal-syntax.js: Added.
  • fast/js/script-tests/parser-syntax-check.js:
  • ietestcenter/Javascript/11.1.5_4-4-b-1-expected.txt:
  • ietestcenter/Javascript/11.1.5_4-4-b-2-expected.txt:
  • ietestcenter/Javascript/11.1.5_4-4-c-1-expected.txt:
  • ietestcenter/Javascript/11.1.5_4-4-c-2-expected.txt:
  • ietestcenter/Javascript/11.1.5_4-4-d-1-expected.txt:
  • ietestcenter/Javascript/11.1.5_4-4-d-2-expected.txt:
  • ietestcenter/Javascript/11.1.5_4-4-d-3-expected.txt:
  • ietestcenter/Javascript/11.1.5_4-4-d-4-expected.txt:
  • platform/chromium/test_expectations.txt:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/parser/Nodes.h

    r60762 r62848  
    405405    class PropertyNode : public ParserArenaFreeable {
    406406    public:
    407         enum Type { Constant, Getter, Setter };
     407        enum Type { Constant = 1, Getter = 2, Setter = 4 };
    408408
    409409        PropertyNode(JSGlobalData*, const Identifier& name, ExpressionNode* value, Type);
     
    411411
    412412        const Identifier& name() const { return m_name; }
     413        Type type() const { return m_type; }
    413414
    414415    private:
Note: See TracChangeset for help on using the changeset viewer.