haikuwebkit/LayoutTests/js/break-ASI-expected.txt

19 lines
563 B
Plaintext
Raw Permalink Normal View History

2010-10-15 Oliver Hunt <oliver@apple.com> Reviewed by Sam Weinig. Automatic Semicolon Insertion incorrectly inserts semicolon after break, continue, and return followed by a newline https://bugs.webkit.org/show_bug.cgi?id=47762 The old YACC parser depended on the lexer for some classes of semicolon insertion. The new parser handles ASI entirely on its own so when the lexer inserts a semicolon on its own the net result is a spurious semicolon in the input stream. This can result in incorrect parsing in some cases: if (0) break ;else {} Would result in a parse failure as the output from the lexer is essentially if (0) break ;;else So the second semicolon is interpreted as a empty statement, which terminates the if, making the else an error. * parser/JSParser.cpp: (JSC::JSParser::parseThrowStatement): Parsing of throw statement was wrong, and only worked due to the weird behaviour in the lexer * parser/Lexer.cpp: (JSC::Lexer::lex): Remove bogus semicolon insertion from the newline handling 2010-10-15 Oliver Hunt <oliver@apple.com> Reviewed by Sam Weinig. ASI incorrectly inserts semicolon after break, continue, and return followed by a newline https://bugs.webkit.org/show_bug.cgi?id=47762 tests for correct ASI following break, continue, and return * fast/js/break-ASI-expected.txt: Added. * fast/js/break-ASI.html: Added. * fast/js/script-tests/break-ASI.js: Added. Canonical link: https://commits.webkit.org/60477@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@69906 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2010-10-16 01:50:16 +00:00
Test to make sure we don't incorrectly insert a semi colon after a break statement
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS do { if(0) break
;else true; } while (0) is true
PASS do { if(0) continue
;else true; } while (0) is true
PASS (function(){if (0) return
;else return true;})() is true
PASS do { if(0) throw 'x';else true; } while (0) is true
2010-10-15 Oliver Hunt <oliver@apple.com> Reviewed by Sam Weinig. Automatic Semicolon Insertion incorrectly inserts semicolon after break, continue, and return followed by a newline https://bugs.webkit.org/show_bug.cgi?id=47762 The old YACC parser depended on the lexer for some classes of semicolon insertion. The new parser handles ASI entirely on its own so when the lexer inserts a semicolon on its own the net result is a spurious semicolon in the input stream. This can result in incorrect parsing in some cases: if (0) break ;else {} Would result in a parse failure as the output from the lexer is essentially if (0) break ;;else So the second semicolon is interpreted as a empty statement, which terminates the if, making the else an error. * parser/JSParser.cpp: (JSC::JSParser::parseThrowStatement): Parsing of throw statement was wrong, and only worked due to the weird behaviour in the lexer * parser/Lexer.cpp: (JSC::Lexer::lex): Remove bogus semicolon insertion from the newline handling 2010-10-15 Oliver Hunt <oliver@apple.com> Reviewed by Sam Weinig. ASI incorrectly inserts semicolon after break, continue, and return followed by a newline https://bugs.webkit.org/show_bug.cgi?id=47762 tests for correct ASI following break, continue, and return * fast/js/break-ASI-expected.txt: Added. * fast/js/break-ASI.html: Added. * fast/js/script-tests/break-ASI.js: Added. Canonical link: https://commits.webkit.org/60477@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@69906 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2010-10-16 01:50:16 +00:00
PASS if (0) throw
Improve JSC Parser error messages https://bugs.webkit.org/show_bug.cgi?id=123341 Reviewed by Andreas Kling. Source/JavaScriptCore: This patch moves away from the current cludgy mechanisms used to produce error messages and moves to something closer to case by case errors. This results in a large change size as previously we may just have 'failIfFalse(foo)', but now the logic becomes either 'failIfFalseWithMessage(foo, "Cannot do blah with ", foo->thing())' Or alternatively if (!foo) check for 'interesting' errors, before falling back to generic error This means that this patch is large, but produces no semantic changes, and only hits slow (e.g. error) paths. * parser/Parser.cpp: (JSC::::Parser): (JSC::::parseSourceElements): (JSC::::parseVarDeclaration): (JSC::::parseConstDeclaration): (JSC::::parseDoWhileStatement): (JSC::::parseWhileStatement): (JSC::::parseVarDeclarationList): (JSC::::createBindingPattern): (JSC::::parseDeconstructionPattern): (JSC::::parseConstDeclarationList): (JSC::::parseForStatement): (JSC::::parseBreakStatement): (JSC::::parseContinueStatement): (JSC::::parseReturnStatement): (JSC::::parseThrowStatement): (JSC::::parseWithStatement): (JSC::::parseSwitchStatement): (JSC::::parseSwitchClauses): (JSC::::parseSwitchDefaultClause): (JSC::::parseTryStatement): (JSC::::parseDebuggerStatement): (JSC::::parseBlockStatement): (JSC::::parseStatement): (JSC::::parseFormalParameters): (JSC::::parseFunctionBody): (JSC::stringForFunctionMode): (JSC::::parseFunctionInfo): (JSC::::parseFunctionDeclaration): (JSC::::parseExpressionOrLabelStatement): (JSC::::parseExpressionStatement): (JSC::::parseIfStatement): (JSC::::parseExpression): (JSC::::parseAssignmentExpression): (JSC::::parseConditionalExpression): (JSC::::parseBinaryExpression): (JSC::::parseProperty): (JSC::::parseObjectLiteral): (JSC::::parseStrictObjectLiteral): (JSC::::parseArrayLiteral): (JSC::::parsePrimaryExpression): (JSC::::parseArguments): (JSC::::parseMemberExpression): (JSC::operatorString): (JSC::::parseUnaryExpression): (JSC::::printUnexpectedTokenText): * parser/Parser.h: (JSC::Scope::hasDeclaredVariable): (JSC::Scope::hasDeclaredParameter): (JSC::Parser::hasDeclaredVariable): (JSC::Parser::hasDeclaredParameter): (JSC::Parser::setErrorMessage): LayoutTests: Update a vast array of layout test results * fast/events/window-onerror5-expected.txt: * js/basic-strict-mode-expected.txt: * js/break-ASI-expected.txt: * js/dom/assign-expected.txt: * js/dom/object-extra-comma-expected.txt: * js/dom/parse-error-external-script-in-eval-expected.txt: * js/dom/parse-error-external-script-in-new-Function-expected.txt: * js/dom/reserved-words-as-property-expected.txt: * js/function-constructor-error-expected.txt: * js/function-declaration-expected.txt: * js/function-toString-object-literals-expected.txt: * js/function-toString-parentheses-expected.txt: * js/js-continue-break-restrictions-expected.txt: * js/kde/garbage-n-expected.txt: * js/kde/parse-expected.txt: * js/no-semi-insertion-at-end-of-script-expected.txt: * js/object-literal-syntax-expected.txt: * js/parser-xml-close-comment-expected.txt: * js/regexp-compile-crash-expected.txt: * js/script-tests/function-constructor-error.js: * js/script-tests/reserved-words-strict.js: (isReserved): * sputnik/Conformance/07_Lexical_Conventions/7.3_Line_Terminators/S7.3_A3.1_T2-expected.txt: * sputnik/Conformance/07_Lexical_Conventions/7.3_Line_Terminators/S7.3_A3.1_T3-expected.txt: * sputnik/Conformance/07_Lexical_Conventions/7.3_Line_Terminators/S7.3_A3.2_T2-expected.txt: * sputnik/Conformance/07_Lexical_Conventions/7.3_Line_Terminators/S7.3_A3.2_T3-expected.txt: * sputnik/Conformance/07_Lexical_Conventions/7.3_Line_Terminators/S7.3_A3.3_T2-expected.txt: * sputnik/Conformance/07_Lexical_Conventions/7.3_Line_Terminators/S7.3_A3.4_T2-expected.txt: * sputnik/Conformance/07_Lexical_Conventions/7.4_Comments/S7.4_A4_T1-expected.txt: * sputnik/Conformance/07_Lexical_Conventions/7.4_Comments/S7.4_A4_T4-expected.txt: * sputnik/Conformance/07_Lexical_Conventions/7.5_Tokens/7.5.2_Keywords/S7.5.2_A1.1-expected.txt: * sputnik/Conformance/07_Lexical_Conventions/7.5_Tokens/7.5.2_Keywords/S7.5.2_A1.10-expected.txt: * sputnik/Conformance/07_Lexical_Conventions/7.5_Tokens/7.5.2_Keywords/S7.5.2_A1.12-expected.txt: * sputnik/Conformance/07_Lexical_Conventions/7.5_Tokens/7.5.2_Keywords/S7.5.2_A1.13-expected.txt: * sputnik/Conformance/07_Lexical_Conventions/7.5_Tokens/7.5.2_Keywords/S7.5.2_A1.14-expected.txt: * sputnik/Conformance/07_Lexical_Conventions/7.5_Tokens/7.5.2_Keywords/S7.5.2_A1.16-expected.txt: * sputnik/Conformance/07_Lexical_Conventions/7.5_Tokens/7.5.2_Keywords/S7.5.2_A1.17-expected.txt: * sputnik/Conformance/07_Lexical_Conventions/7.5_Tokens/7.5.2_Keywords/S7.5.2_A1.2-expected.txt: * sputnik/Conformance/07_Lexical_Conventions/7.5_Tokens/7.5.2_Keywords/S7.5.2_A1.20-expected.txt: * sputnik/Conformance/07_Lexical_Conventions/7.5_Tokens/7.5.2_Keywords/S7.5.2_A1.22-expected.txt: * sputnik/Conformance/07_Lexical_Conventions/7.5_Tokens/7.5.2_Keywords/S7.5.2_A1.24-expected.txt: * sputnik/Conformance/07_Lexical_Conventions/7.5_Tokens/7.5.2_Keywords/S7.5.2_A1.25-expected.txt: * sputnik/Conformance/07_Lexical_Conventions/7.5_Tokens/7.5.2_Keywords/S7.5.2_A1.3-expected.txt: * sputnik/Conformance/07_Lexical_Conventions/7.5_Tokens/7.5.2_Keywords/S7.5.2_A1.4-expected.txt: * sputnik/Conformance/07_Lexical_Conventions/7.5_Tokens/7.5.2_Keywords/S7.5.2_A1.5-expected.txt: * sputnik/Conformance/07_Lexical_Conventions/7.5_Tokens/7.5.2_Keywords/S7.5.2_A1.8-expected.txt: * sputnik/Conformance/07_Lexical_Conventions/7.5_Tokens/7.5.2_Keywords/S7.5.2_A1.9-expected.txt: * sputnik/Conformance/07_Lexical_Conventions/7.5_Tokens/7.5.3_Future_Reserved_Words/S7.5.3_A1.10-expected.txt: * sputnik/Conformance/07_Lexical_Conventions/7.5_Tokens/7.5.3_Future_Reserved_Words/S7.5.3_A1.11-expected.txt: * sputnik/Conformance/07_Lexical_Conventions/7.5_Tokens/7.5.3_Future_Reserved_Words/S7.5.3_A1.16-expected.txt: * sputnik/Conformance/07_Lexical_Conventions/7.5_Tokens/7.5.3_Future_Reserved_Words/S7.5.3_A1.27-expected.txt: * sputnik/Conformance/07_Lexical_Conventions/7.5_Tokens/7.5.3_Future_Reserved_Words/S7.5.3_A1.5-expected.txt: * sputnik/Conformance/07_Lexical_Conventions/7.5_Tokens/7.5.3_Future_Reserved_Words/S7.5.3_A1.6-expected.txt: * sputnik/Conformance/07_Lexical_Conventions/7.5_Tokens/7.5.3_Future_Reserved_Words/S7.5.3_A1.7-expected.txt: * sputnik/Conformance/07_Lexical_Conventions/7.5_Tokens/7.5.3_Future_Reserved_Words/S7.5.3_A1.9-expected.txt: * sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.5_Regular_Expression_Literals/S7.8.5_A1.2_T2-expected.txt: * sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.5_Regular_Expression_Literals/S7.8.5_A1.3_T1-expected.txt: * sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.5_Regular_Expression_Literals/S7.8.5_A1.3_T3-expected.txt: * sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.5_Regular_Expression_Literals/S7.8.5_A1.5_T1-expected.txt: * sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.5_Regular_Expression_Literals/S7.8.5_A1.5_T3-expected.txt: * sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.5_Regular_Expression_Literals/S7.8.5_A2.2_T1-expected.txt: * sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.5_Regular_Expression_Literals/S7.8.5_A2.3_T1-expected.txt: * sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.5_Regular_Expression_Literals/S7.8.5_A2.3_T3-expected.txt: * sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.5_Regular_Expression_Literals/S7.8.5_A2.5_T1-expected.txt: * sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.5_Regular_Expression_Literals/S7.8.5_A2.5_T3-expected.txt: * sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.5_Regular_Expression_Literals/S7.8.5_A3.1_T7-expected.txt: * sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.5_Regular_Expression_Literals/S7.8.5_A3.1_T8-expected.txt: * sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.5_Regular_Expression_Literals/S7.8.5_A3.1_T9-expected.txt: * sputnik/Conformance/07_Lexical_Conventions/7.9_Automatic_Semicolon_Insertion/7.9.2_Examples/S7.9.2_A1_T1-expected.txt: * sputnik/Conformance/07_Lexical_Conventions/7.9_Automatic_Semicolon_Insertion/7.9.2_Examples/S7.9.2_A1_T3-expected.txt: * sputnik/Conformance/07_Lexical_Conventions/7.9_Automatic_Semicolon_Insertion/7.9.2_Examples/S7.9.2_A1_T6-expected.txt: * sputnik/Conformance/07_Lexical_Conventions/7.9_Automatic_Semicolon_Insertion/S7.9_A10_T4-expected.txt: * sputnik/Conformance/07_Lexical_Conventions/7.9_Automatic_Semicolon_Insertion/S7.9_A10_T8-expected.txt: * sputnik/Conformance/07_Lexical_Conventions/7.9_Automatic_Semicolon_Insertion/S7.9_A11_T4-expected.txt: * sputnik/Conformance/07_Lexical_Conventions/7.9_Automatic_Semicolon_Insertion/S7.9_A11_T8-expected.txt: * sputnik/Conformance/07_Lexical_Conventions/7.9_Automatic_Semicolon_Insertion/S7.9_A4-expected.txt: * sputnik/Conformance/07_Lexical_Conventions/7.9_Automatic_Semicolon_Insertion/S7.9_A6.2_T5-expected.txt: * sputnik/Conformance/07_Lexical_Conventions/7.9_Automatic_Semicolon_Insertion/S7.9_A6.2_T6-expected.txt: * sputnik/Conformance/07_Lexical_Conventions/7.9_Automatic_Semicolon_Insertion/S7.9_A6.2_T8-expected.txt: * sputnik/Conformance/07_Lexical_Conventions/7.9_Automatic_Semicolon_Insertion/S7.9_A6.2_T9-expected.txt: * sputnik/Conformance/07_Lexical_Conventions/7.9_Automatic_Semicolon_Insertion/S7.9_A6.3_T4-expected.txt: * sputnik/Conformance/07_Lexical_Conventions/7.9_Automatic_Semicolon_Insertion/S7.9_A6.3_T5-expected.txt: * sputnik/Conformance/07_Lexical_Conventions/7.9_Automatic_Semicolon_Insertion/S7.9_A6.3_T6-expected.txt: * sputnik/Conformance/07_Lexical_Conventions/7.9_Automatic_Semicolon_Insertion/S7.9_A6.3_T7-expected.txt: * sputnik/Conformance/07_Lexical_Conventions/7.9_Automatic_Semicolon_Insertion/S7.9_A6.4_T1-expected.txt: * sputnik/Conformance/07_Lexical_Conventions/7.9_Automatic_Semicolon_Insertion/S7.9_A9_T6-expected.txt: * sputnik/Conformance/07_Lexical_Conventions/7.9_Automatic_Semicolon_Insertion/S7.9_A9_T7-expected.txt: * sputnik/Conformance/07_Lexical_Conventions/7.9_Automatic_Semicolon_Insertion/S7.9_A9_T8-expected.txt: * sputnik/Conformance/08_Types/8.2_The_Null_Type/S8.2_A2-expected.txt: * sputnik/Conformance/08_Types/8.4_The_String_Type/S8.4_A13_T3-expected.txt: * sputnik/Conformance/08_Types/8.4_The_String_Type/S8.4_A14_T3-expected.txt: * sputnik/Conformance/11_Expressions/11.3_PostfixExpressions/11.3.1_Postfix_Increment_Operator/S11.3.1_A1.1_T1-expected.txt: * sputnik/Conformance/11_Expressions/11.3_PostfixExpressions/11.3.1_Postfix_Increment_Operator/S11.3.1_A1.1_T2-expected.txt: * sputnik/Conformance/11_Expressions/11.3_PostfixExpressions/11.3.1_Postfix_Increment_Operator/S11.3.1_A1.1_T3-expected.txt: * sputnik/Conformance/11_Expressions/11.3_PostfixExpressions/11.3.1_Postfix_Increment_Operator/S11.3.1_A1.1_T4-expected.txt: * sputnik/Conformance/11_Expressions/11.3_PostfixExpressions/11.3.2_Postfix_Decrement_Operator/S11.3.2_A1.1_T1-expected.txt: * sputnik/Conformance/11_Expressions/11.3_PostfixExpressions/11.3.2_Postfix_Decrement_Operator/S11.3.2_A1.1_T2-expected.txt: * sputnik/Conformance/11_Expressions/11.3_PostfixExpressions/11.3.2_Postfix_Decrement_Operator/S11.3.2_A1.1_T3-expected.txt: * sputnik/Conformance/11_Expressions/11.3_PostfixExpressions/11.3.2_Postfix_Decrement_Operator/S11.3.2_A1.1_T4-expected.txt: * sputnik/Conformance/12_Statement/12.11_The_switch_Statement/S12.11_A2_T1-expected.txt: * sputnik/Conformance/12_Statement/12.11_The_switch_Statement/S12.11_A3_T2-expected.txt: * sputnik/Conformance/12_Statement/12.11_The_switch_Statement/S12.11_A3_T3-expected.txt: * sputnik/Conformance/12_Statement/12.11_The_switch_Statement/S12.11_A3_T5-expected.txt: * sputnik/Conformance/12_Statement/12.14_The_try_Statement/S12.14_A16_T1-expected.txt: * sputnik/Conformance/12_Statement/12.14_The_try_Statement/S12.14_A16_T10-expected.txt: * sputnik/Conformance/12_Statement/12.14_The_try_Statement/S12.14_A16_T11-expected.txt: * sputnik/Conformance/12_Statement/12.14_The_try_Statement/S12.14_A16_T12-expected.txt: * sputnik/Conformance/12_Statement/12.14_The_try_Statement/S12.14_A16_T13-expected.txt: * sputnik/Conformance/12_Statement/12.14_The_try_Statement/S12.14_A16_T14-expected.txt: * sputnik/Conformance/12_Statement/12.14_The_try_Statement/S12.14_A16_T15-expected.txt: * sputnik/Conformance/12_Statement/12.14_The_try_Statement/S12.14_A16_T2-expected.txt: * sputnik/Conformance/12_Statement/12.14_The_try_Statement/S12.14_A16_T3-expected.txt: * sputnik/Conformance/12_Statement/12.14_The_try_Statement/S12.14_A16_T4-expected.txt: * sputnik/Conformance/12_Statement/12.14_The_try_Statement/S12.14_A16_T5-expected.txt: * sputnik/Conformance/12_Statement/12.14_The_try_Statement/S12.14_A16_T6-expected.txt: * sputnik/Conformance/12_Statement/12.14_The_try_Statement/S12.14_A16_T7-expected.txt: * sputnik/Conformance/12_Statement/12.14_The_try_Statement/S12.14_A16_T8-expected.txt: * sputnik/Conformance/12_Statement/12.14_The_try_Statement/S12.14_A16_T9-expected.txt: * sputnik/Conformance/12_Statement/12.1_Block/S12.1_A4_T1-expected.txt: * sputnik/Conformance/12_Statement/12.1_Block/S12.1_A4_T2-expected.txt: * sputnik/Conformance/12_Statement/12.2_Variable_Statement/S12.2_A8_T1-expected.txt: * sputnik/Conformance/12_Statement/12.2_Variable_Statement/S12.2_A8_T2-expected.txt: * sputnik/Conformance/12_Statement/12.2_Variable_Statement/S12.2_A8_T3-expected.txt: * sputnik/Conformance/12_Statement/12.2_Variable_Statement/S12.2_A8_T4-expected.txt: * sputnik/Conformance/12_Statement/12.2_Variable_Statement/S12.2_A8_T5-expected.txt: * sputnik/Conformance/12_Statement/12.2_Variable_Statement/S12.2_A8_T6-expected.txt: * sputnik/Conformance/12_Statement/12.2_Variable_Statement/S12.2_A8_T7-expected.txt: * sputnik/Conformance/12_Statement/12.2_Variable_Statement/S12.2_A8_T8-expected.txt: * sputnik/Conformance/12_Statement/12.4_Expression_Statement/S12.4_A1-expected.txt: * sputnik/Conformance/12_Statement/12.5_The_if_Statement/S12.5_A11-expected.txt: * sputnik/Conformance/12_Statement/12.5_The_if_Statement/S12.5_A6_T1-expected.txt: * sputnik/Conformance/12_Statement/12.5_The_if_Statement/S12.5_A6_T2-expected.txt: * sputnik/Conformance/12_Statement/12.5_The_if_Statement/S12.5_A9_T3-expected.txt: * sputnik/Conformance/12_Statement/12.6_Iteration_Statements/12.6.1_The_do_while_Statement/S12.6.1_A12-expected.txt: * sputnik/Conformance/12_Statement/12.6_Iteration_Statements/12.6.1_The_do_while_Statement/S12.6.1_A13_T3-expected.txt: * sputnik/Conformance/12_Statement/12.6_Iteration_Statements/12.6.1_The_do_while_Statement/S12.6.1_A15-expected.txt: * sputnik/Conformance/12_Statement/12.6_Iteration_Statements/12.6.1_The_do_while_Statement/S12.6.1_A6_T1-expected.txt: * sputnik/Conformance/12_Statement/12.6_Iteration_Statements/12.6.1_The_do_while_Statement/S12.6.1_A6_T2-expected.txt: * sputnik/Conformance/12_Statement/12.6_Iteration_Statements/12.6.1_The_do_while_Statement/S12.6.1_A6_T3-expected.txt: * sputnik/Conformance/12_Statement/12.6_Iteration_Statements/12.6.1_The_do_while_Statement/S12.6.1_A6_T4-expected.txt: * sputnik/Conformance/12_Statement/12.6_Iteration_Statements/12.6.1_The_do_while_Statement/S12.6.1_A6_T5-expected.txt: * sputnik/Conformance/12_Statement/12.6_Iteration_Statements/12.6.1_The_do_while_Statement/S12.6.1_A6_T6-expected.txt: * sputnik/Conformance/12_Statement/12.6_Iteration_Statements/12.6.2_The_while_statement/S12.6.2_A13_T3-expected.txt: * sputnik/Conformance/12_Statement/12.6_Iteration_Statements/12.6.2_The_while_statement/S12.6.2_A15-expected.txt: * sputnik/Conformance/12_Statement/12.6_Iteration_Statements/12.6.2_The_while_statement/S12.6.2_A6_T1-expected.txt: * sputnik/Conformance/12_Statement/12.6_Iteration_Statements/12.6.2_The_while_statement/S12.6.2_A6_T2-expected.txt: * sputnik/Conformance/12_Statement/12.6_Iteration_Statements/12.6.2_The_while_statement/S12.6.2_A6_T3-expected.txt: * sputnik/Conformance/12_Statement/12.6_Iteration_Statements/12.6.2_The_while_statement/S12.6.2_A6_T4-expected.txt: * sputnik/Conformance/12_Statement/12.6_Iteration_Statements/12.6.2_The_while_statement/S12.6.2_A6_T5-expected.txt: * sputnik/Conformance/12_Statement/12.6_Iteration_Statements/12.6.2_The_while_statement/S12.6.2_A6_T6-expected.txt: * sputnik/Conformance/12_Statement/12.6_Iteration_Statements/12.6.3_The_for_Statement/S12.6.3_A11.1_T3-expected.txt: * sputnik/Conformance/12_Statement/12.6_Iteration_Statements/12.6.3_The_for_Statement/S12.6.3_A11_T3-expected.txt: * sputnik/Conformance/12_Statement/12.6_Iteration_Statements/12.6.3_The_for_Statement/S12.6.3_A12.1_T3-expected.txt: * sputnik/Conformance/12_Statement/12.6_Iteration_Statements/12.6.3_The_for_Statement/S12.6.3_A12_T3-expected.txt: * sputnik/Conformance/12_Statement/12.6_Iteration_Statements/12.6.3_The_for_Statement/S12.6.3_A4.1-expected.txt: * sputnik/Conformance/12_Statement/12.6_Iteration_Statements/12.6.3_The_for_Statement/S12.6.3_A4_T1-expected.txt: * sputnik/Conformance/12_Statement/12.6_Iteration_Statements/12.6.3_The_for_Statement/S12.6.3_A4_T2-expected.txt: * sputnik/Conformance/12_Statement/12.6_Iteration_Statements/12.6.3_The_for_Statement/S12.6.3_A7.1_T1-expected.txt: * sputnik/Conformance/12_Statement/12.6_Iteration_Statements/12.6.3_The_for_Statement/S12.6.3_A7.1_T2-expected.txt: * sputnik/Conformance/12_Statement/12.6_Iteration_Statements/12.6.3_The_for_Statement/S12.6.3_A7_T1-expected.txt: * sputnik/Conformance/12_Statement/12.6_Iteration_Statements/12.6.3_The_for_Statement/S12.6.3_A7_T2-expected.txt: * sputnik/Conformance/12_Statement/12.6_Iteration_Statements/12.6.3_The_for_Statement/S12.6.3_A8.1_T1-expected.txt: * sputnik/Conformance/12_Statement/12.6_Iteration_Statements/12.6.3_The_for_Statement/S12.6.3_A8.1_T2-expected.txt: * sputnik/Conformance/12_Statement/12.6_Iteration_Statements/12.6.3_The_for_Statement/S12.6.3_A8.1_T3-expected.txt: * sputnik/Conformance/12_Statement/12.6_Iteration_Statements/12.6.3_The_for_Statement/S12.6.3_A8_T1-expected.txt: * sputnik/Conformance/12_Statement/12.6_Iteration_Statements/12.6.3_The_for_Statement/S12.6.3_A8_T2-expected.txt: * sputnik/Conformance/12_Statement/12.6_Iteration_Statements/12.6.3_The_for_Statement/S12.6.3_A8_T3-expected.txt: * sputnik/Conformance/12_Statement/12.6_Iteration_Statements/12.6.4_The_for_in_Statement/S12.6.4_A13_T3-expected.txt: * sputnik/Conformance/12_Statement/12.6_Iteration_Statements/12.6.4_The_for_in_Statement/S12.6.4_A15-expected.txt: * sputnik/Conformance/12_Statement/12.7_The_continue_Statement/S12.7_A1_T1-expected.txt: * sputnik/Conformance/12_Statement/12.7_The_continue_Statement/S12.7_A1_T2-expected.txt: * sputnik/Conformance/12_Statement/12.7_The_continue_Statement/S12.7_A1_T3-expected.txt: * sputnik/Conformance/12_Statement/12.7_The_continue_Statement/S12.7_A1_T4-expected.txt: * sputnik/Conformance/12_Statement/12.7_The_continue_Statement/S12.7_A5_T1-expected.txt: * sputnik/Conformance/12_Statement/12.7_The_continue_Statement/S12.7_A5_T2-expected.txt: * sputnik/Conformance/12_Statement/12.7_The_continue_Statement/S12.7_A5_T3-expected.txt: * sputnik/Conformance/12_Statement/12.7_The_continue_Statement/S12.7_A6-expected.txt: * sputnik/Conformance/12_Statement/12.7_The_continue_Statement/S12.7_A8_T1-expected.txt: * sputnik/Conformance/12_Statement/12.7_The_continue_Statement/S12.7_A8_T2-expected.txt: * sputnik/Conformance/12_Statement/12.8_The_break_Statement/S12.8_A1_T1-expected.txt: * sputnik/Conformance/12_Statement/12.8_The_break_Statement/S12.8_A1_T2-expected.txt: * sputnik/Conformance/12_Statement/12.8_The_break_Statement/S12.8_A1_T3-expected.txt: * sputnik/Conformance/12_Statement/12.8_The_break_Statement/S12.8_A1_T4-expected.txt: * sputnik/Conformance/12_Statement/12.8_The_break_Statement/S12.8_A5_T1-expected.txt: * sputnik/Conformance/12_Statement/12.8_The_break_Statement/S12.8_A5_T2-expected.txt: * sputnik/Conformance/12_Statement/12.8_The_break_Statement/S12.8_A5_T3-expected.txt: * sputnik/Conformance/12_Statement/12.8_The_break_Statement/S12.8_A6-expected.txt: * sputnik/Conformance/12_Statement/12.8_The_break_Statement/S12.8_A8_T1-expected.txt: * sputnik/Conformance/12_Statement/12.8_The_break_Statement/S12.8_A8_T2-expected.txt: * sputnik/Conformance/12_Statement/12.9_The_return_Statement/S12.9_A1_T1-expected.txt: * sputnik/Conformance/12_Statement/12.9_The_return_Statement/S12.9_A1_T10-expected.txt: * sputnik/Conformance/12_Statement/12.9_The_return_Statement/S12.9_A1_T2-expected.txt: * sputnik/Conformance/12_Statement/12.9_The_return_Statement/S12.9_A1_T3-expected.txt: * sputnik/Conformance/12_Statement/12.9_The_return_Statement/S12.9_A1_T4-expected.txt: * sputnik/Conformance/12_Statement/12.9_The_return_Statement/S12.9_A1_T5-expected.txt: * sputnik/Conformance/12_Statement/12.9_The_return_Statement/S12.9_A1_T6-expected.txt: * sputnik/Conformance/12_Statement/12.9_The_return_Statement/S12.9_A1_T7-expected.txt: * sputnik/Conformance/12_Statement/12.9_The_return_Statement/S12.9_A1_T8-expected.txt: * sputnik/Conformance/12_Statement/12.9_The_return_Statement/S12.9_A1_T9-expected.txt: * sputnik/Conformance/15_Native_Objects/15.1_The_Global_Object/15.1.2/15.1.2.1_eval/S15.1.2.1_A2_T2-expected.txt: * sputnik/Conformance/15_Native_Objects/15.3_Function/15.3.4/15.3.4.2_Function.prototype.toString/S15.3.4.2_A1_T1-expected.txt: Canonical link: https://commits.webkit.org/141440@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@158014 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-10-25 17:13:16 +00:00
'Shouldn't have parsed this.'; threw exception SyntaxError: Cannot have a newline after 'throw'..
2010-10-15 Oliver Hunt <oliver@apple.com> Reviewed by Sam Weinig. Automatic Semicolon Insertion incorrectly inserts semicolon after break, continue, and return followed by a newline https://bugs.webkit.org/show_bug.cgi?id=47762 The old YACC parser depended on the lexer for some classes of semicolon insertion. The new parser handles ASI entirely on its own so when the lexer inserts a semicolon on its own the net result is a spurious semicolon in the input stream. This can result in incorrect parsing in some cases: if (0) break ;else {} Would result in a parse failure as the output from the lexer is essentially if (0) break ;;else So the second semicolon is interpreted as a empty statement, which terminates the if, making the else an error. * parser/JSParser.cpp: (JSC::JSParser::parseThrowStatement): Parsing of throw statement was wrong, and only worked due to the weird behaviour in the lexer * parser/Lexer.cpp: (JSC::Lexer::lex): Remove bogus semicolon insertion from the newline handling 2010-10-15 Oliver Hunt <oliver@apple.com> Reviewed by Sam Weinig. ASI incorrectly inserts semicolon after break, continue, and return followed by a newline https://bugs.webkit.org/show_bug.cgi?id=47762 tests for correct ASI following break, continue, and return * fast/js/break-ASI-expected.txt: Added. * fast/js/break-ASI.html: Added. * fast/js/script-tests/break-ASI.js: Added. Canonical link: https://commits.webkit.org/60477@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@69906 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2010-10-16 01:50:16 +00:00
PASS successfullyParsed is true
TEST COMPLETE