2010-07-08 Oliver Hunt <oliver@apple.com>
authoroliver@apple.com <oliver@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 8 Jul 2010 21:54:08 +0000 (21:54 +0000)
committeroliver@apple.com <oliver@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 8 Jul 2010 21:54:08 +0000 (21:54 +0000)
commit7537412371681b81b597d225ebb2e4ff2969258a
tree78b582ad1ded55730fd6626e349504c792851f4f
parent0fbc68a223a4375fc3ef84c91db8c3b241118603
2010-07-08  Oliver Hunt  <oliver@apple.com>

        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  <oliver@apple.com>

        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:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@62848 268f45cc-cd09-0410-ab3c-d52691b4dbfc
25 files changed:
JavaScriptCore/ChangeLog
JavaScriptCore/parser/ASTBuilder.h
JavaScriptCore/parser/JSParser.cpp
JavaScriptCore/parser/JSParser.h
JavaScriptCore/parser/Lexer.cpp
JavaScriptCore/parser/Lexer.h
JavaScriptCore/parser/Nodes.h
JavaScriptCore/parser/Parser.cpp
JavaScriptCore/parser/SourceProvider.h
JavaScriptCore/parser/SyntaxChecker.h
LayoutTests/ChangeLog
LayoutTests/fast/js/object-literal-syntax-expected.txt [new file with mode: 0644]
LayoutTests/fast/js/object-literal-syntax.html [new file with mode: 0644]
LayoutTests/fast/js/parser-syntax-check-expected.txt
LayoutTests/fast/js/script-tests/object-literal-syntax.js [new file with mode: 0644]
LayoutTests/fast/js/script-tests/parser-syntax-check.js
LayoutTests/ietestcenter/Javascript/11.1.5_4-4-b-1-expected.txt
LayoutTests/ietestcenter/Javascript/11.1.5_4-4-b-2-expected.txt
LayoutTests/ietestcenter/Javascript/11.1.5_4-4-c-1-expected.txt
LayoutTests/ietestcenter/Javascript/11.1.5_4-4-c-2-expected.txt
LayoutTests/ietestcenter/Javascript/11.1.5_4-4-d-1-expected.txt
LayoutTests/ietestcenter/Javascript/11.1.5_4-4-d-2-expected.txt
LayoutTests/ietestcenter/Javascript/11.1.5_4-4-d-3-expected.txt
LayoutTests/ietestcenter/Javascript/11.1.5_4-4-d-4-expected.txt
LayoutTests/platform/chromium/test_expectations.txt