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

    r62449 r62848  
    3939        SourceProvider(const UString& url)
    4040            : m_url(url)
     41            , m_validated(false)
    4142        {
    4243        }
     
    5051        intptr_t asID() { return reinterpret_cast<intptr_t>(this); }
    5152
     53        bool isValid() const { return m_validated; }
     54        void setValid() { m_validated = true; }
     55
    5256    private:
    5357        UString m_url;
     58        bool m_validated;
    5459    };
    5560
Note: See TracChangeset for help on using the changeset viewer.