Commit 039f9247 authored by oliver@apple.com's avatar oliver@apple.com

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:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158014 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent a1d4e9cd
This diff is collapsed.
Test that window.onerror is invoked for syntax error in eval. You should see a log record if window.onerror is working properly for this test.Bug 8519.
Error caught successfully: SyntaxError: Unexpected EOF File: window-onerror5.html Line: 16 Column: 9
Error caught successfully: SyntaxError: Unexpected end of script File: window-onerror5.html Line: 16 Column: 9
......@@ -33,8 +33,8 @@ Testing regexp: /a\_/
PASS regexp.test('a_') is true
Testing regexp: [invalid \ variations]
PASS /\/ threw exception SyntaxError: Unexpected token '/'.
PASS /a\/ threw exception SyntaxError: Unexpected token '/'.
PASS /\/ threw exception SyntaxError: Unexpected token '/'. Invalid regular expression..
PASS /a\/ threw exception SyntaxError: Unexpected token '/'. Invalid regular expression..
Testing regexp: /./
PASS regexp.test('a') is true
......@@ -80,8 +80,8 @@ PASS /)/ threw exception SyntaxError: Invalid regular expression: unmatched pare
PASS /a)/ threw exception SyntaxError: Invalid regular expression: unmatched parentheses.
Testing regexp: [invalid [ variations]
PASS /[/ threw exception SyntaxError: Unexpected token '/'.
PASS /a[/ threw exception SyntaxError: Unexpected token '/'.
PASS /[/ threw exception SyntaxError: Unexpected token '/'. Invalid regular expression..
PASS /a[/ threw exception SyntaxError: Unexpected token '/'. Invalid regular expression..
PASS /[b-a]/ threw exception SyntaxError: Invalid regular expression: range out of order in character class.
PASS /a[b-a]/ threw exception SyntaxError: Invalid regular expression: range out of order in character class.
......
......@@ -27,7 +27,7 @@ Loaded resource 1
PASS: Threw Error: NETWORK_ERR: XMLHttpRequest Exception 101 when load failed
PASS: some resources were loaded despite the network error
Loaded resource 1
PASS: Threw SyntaxError: Expected an identifier but found 'syntax' instead when encountering a syntax error in imported script
PASS: Threw SyntaxError: Unexpected identifier 'syntax' when encountering a syntax error in imported script
PASS: some resources were loaded despite the presence of a syntax error
Testing multiple arguments, with first resource throwing an exception:
Loaded resource 1
......
......@@ -27,7 +27,7 @@ Loaded resource 1
PASS: Threw Error: NETWORK_ERR: XMLHttpRequest Exception 101 when load failed
PASS: some resources were loaded despite the network error
Loaded resource 1
PASS: Threw SyntaxError: Expected an identifier but found 'syntax' instead when encountering a syntax error in imported script
PASS: Threw SyntaxError: Unexpected identifier 'syntax' when encountering a syntax error in imported script
PASS: some resources were loaded despite the presence of a syntax error
Testing multiple arguments, with first resource throwing an exception:
Loaded resource 1
......
......@@ -11,7 +11,7 @@ PASS (function(){if (0) return
;else return true;})() is true
PASS do { if(0) throw 'x';else true; } while (0) is true
PASS if (0) throw
'Shouldn't have parsed this.'; threw exception SyntaxError: Unexpected string 'Shouldn'.
'Shouldn't have parsed this.'; threw exception SyntaxError: Cannot have a newline after 'throw'..
PASS successfullyParsed is true
TEST COMPLETE
......
......@@ -15,7 +15,7 @@ PASS ((window.x)) = 9; x is 9
PASS ((window["x"])) = 10; x is 10
PASS (y, x) = "FAIL"; threw exception ReferenceError: Left side of assignment is not a reference..
PASS (true ? x : y) = "FAIL"; threw exception ReferenceError: Left side of assignment is not a reference..
PASS x++ = "FAIL"; threw exception SyntaxError: Unexpected token '='.
PASS x++ = "FAIL"; threw exception SyntaxError: Left hand sign of operator '=' must be a reference..
PASS successfullyParsed is true
TEST COMPLETE
......
......@@ -6,8 +6,8 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
PASS var foo = { 'bar' : 'YES' }; foo.bar is 'YES'
PASS var foo = { 'bar' : 'YES', }; foo.bar is 'YES'
PASS var foo = { 'bar' : 'YES' , }; foo.bar is 'YES'
PASS var foo = { , 'bar' : 'YES' }; foo.bar threw exception SyntaxError: Unexpected token ','.
PASS var foo = { 'bar' : 'YES',, }; foo.bar threw exception SyntaxError: Unexpected token ','.
PASS var foo = { , 'bar' : 'YES' }; foo.bar threw exception SyntaxError: Unexpected token ','. Expected a property name..
PASS var foo = { 'bar' : 'YES',, }; foo.bar threw exception SyntaxError: Unexpected token ','. Expected a property name..
PASS successfullyParsed is true
TEST COMPLETE
......
CONSOLE MESSAGE: line 2: SyntaxError: Expected an identifier but found 'error' instead
CONSOLE MESSAGE: line 2: SyntaxError: Unexpected identifier 'error'
This tests that a line number and error message is printed for a parse error in a separate source file using eval().
CONSOLE MESSAGE: line 3: SyntaxError: Expected an identifier but found 'error' instead
CONSOLE MESSAGE: line 3: SyntaxError: Unexpected identifier 'error'
This tests that a line number and error message is printed for a parse error in a separate source file using new Function().
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -3,8 +3,8 @@ This test checks that the Function constructor detects some syntax errors correc
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS Function('(i + (j)') threw exception SyntaxError: Expected token ')'.
PASS Function('return (i + (j)') threw exception SyntaxError: Expected token ')'.
PASS Function('(i + (j)') threw exception SyntaxError: Unexpected token '}'. Expected ')' to end a compound expression..
PASS Function('return (i + (j)') threw exception SyntaxError: Unexpected token '}'. Expected ')' to end a compound expression..
PASS successfullyParsed is true
TEST COMPLETE
......
......@@ -5,7 +5,7 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
PASS eval('function f(){return true;}') is undefined.
PASS eval('function f(){return true;};f')() is true
PASS eval('function(){return false;}')() threw exception SyntaxError: Unexpected token '('.
PASS eval('function(){return false;}')() threw exception SyntaxError: Function statements must have a name..
PASS successfullyParsed is true
TEST COMPLETE
......
......@@ -19,11 +19,11 @@ PASS compileAndSerialize('a = { "\'": null }') is 'a = { "\'": null }'
PASS compileAndSerialize('a = { "\\"": null }') is 'a = { "\\"": null }'
PASS compileAndSerialize('a = { get x() { } }') is 'a = { get x() { } }'
PASS compileAndSerialize('a = { set x(y) { } }') is 'a = { set x(y) { } }'
PASS compileAndSerialize('a = { --1: null }') threw exception SyntaxError: Unexpected token '--'.
PASS compileAndSerialize('a = { -NaN: null }') threw exception SyntaxError: Unexpected token '-'.
PASS compileAndSerialize('a = { -0: null }') threw exception SyntaxError: Unexpected token '-'.
PASS compileAndSerialize('a = { -0.0: null }') threw exception SyntaxError: Unexpected token '-'.
PASS compileAndSerialize('a = { -Infinity: null }') threw exception SyntaxError: Unexpected token '-'.
PASS compileAndSerialize('a = { --1: null }') threw exception SyntaxError: Unexpected token '--'. Expected a property name..
PASS compileAndSerialize('a = { -NaN: null }') threw exception SyntaxError: Unexpected token '-'. Expected a property name..
PASS compileAndSerialize('a = { -0: null }') threw exception SyntaxError: Unexpected token '-'. Expected a property name..
PASS compileAndSerialize('a = { -0.0: null }') threw exception SyntaxError: Unexpected token '-'. Expected a property name..
PASS compileAndSerialize('a = { -Infinity: null }') threw exception SyntaxError: Unexpected token '-'. Expected a property name..
PASS successfullyParsed is true
TEST COMPLETE
......
......@@ -216,7 +216,7 @@ PASS compileAndSerialize('a = (b = c)') is 'a = (b = c)'
PASS compileAndSerialize('a = b + c') is 'a = b + c'
PASS compileAndSerialize('(a = b) + c') is '(a = b) + c'
PASS compileAndSerialize('a = (b + c)') is 'a = (b + c)'
PASS compileAndSerialize('a + b = c') threw exception SyntaxError: Unexpected token '='.
PASS compileAndSerialize('a + b = c') threw exception SyntaxError: Left hand sign of operator '=' must be a reference..
PASS compileAndSerialize('(a + b) = c') is '(a + b) = c'
PASS compileAndSerialize('a + (b = c)') is 'a + (b = c)'
PASS compileAndSerialize('a *= b *= c') is 'a *= b *= c'
......@@ -228,7 +228,7 @@ PASS compileAndSerialize('a = (b *= c)') is 'a = (b *= c)'
PASS compileAndSerialize('a *= b + c') is 'a *= b + c'
PASS compileAndSerialize('(a *= b) + c') is '(a *= b) + c'
PASS compileAndSerialize('a *= (b + c)') is 'a *= (b + c)'
PASS compileAndSerialize('a + b *= c') threw exception SyntaxError: Unexpected token '*='.
PASS compileAndSerialize('a + b *= c') threw exception SyntaxError: Left hand sign of operator '*=' must be a reference..
PASS compileAndSerialize('(a + b) *= c') is '(a + b) *= c'
PASS compileAndSerialize('a + (b *= c)') is 'a + (b *= c)'
PASS compileAndSerialize('a /= b /= c') is 'a /= b /= c'
......@@ -240,7 +240,7 @@ PASS compileAndSerialize('a = (b /= c)') is 'a = (b /= c)'
PASS compileAndSerialize('a /= b + c') is 'a /= b + c'
PASS compileAndSerialize('(a /= b) + c') is '(a /= b) + c'
PASS compileAndSerialize('a /= (b + c)') is 'a /= (b + c)'
PASS compileAndSerialize('a + b /= c') threw exception SyntaxError: Unexpected token '/='.
PASS compileAndSerialize('a + b /= c') threw exception SyntaxError: Left hand sign of operator '/=' must be a reference..
PASS compileAndSerialize('(a + b) /= c') is '(a + b) /= c'
PASS compileAndSerialize('a + (b /= c)') is 'a + (b /= c)'
PASS compileAndSerialize('a %= b %= c') is 'a %= b %= c'
......@@ -252,7 +252,7 @@ PASS compileAndSerialize('a = (b %= c)') is 'a = (b %= c)'
PASS compileAndSerialize('a %= b + c') is 'a %= b + c'
PASS compileAndSerialize('(a %= b) + c') is '(a %= b) + c'
PASS compileAndSerialize('a %= (b + c)') is 'a %= (b + c)'
PASS compileAndSerialize('a + b %= c') threw exception SyntaxError: Unexpected token '%='.
PASS compileAndSerialize('a + b %= c') threw exception SyntaxError: Left hand sign of operator '%=' must be a reference..
PASS compileAndSerialize('(a + b) %= c') is '(a + b) %= c'
PASS compileAndSerialize('a + (b %= c)') is 'a + (b %= c)'
PASS compileAndSerialize('a += b += c') is 'a += b += c'
......@@ -264,7 +264,7 @@ PASS compileAndSerialize('a = (b += c)') is 'a = (b += c)'
PASS compileAndSerialize('a += b + c') is 'a += b + c'
PASS compileAndSerialize('(a += b) + c') is '(a += b) + c'
PASS compileAndSerialize('a += (b + c)') is 'a += (b + c)'
PASS compileAndSerialize('a + b += c') threw exception SyntaxError: Unexpected token '+='.
PASS compileAndSerialize('a + b += c') threw exception SyntaxError: Left hand sign of operator '+=' must be a reference..
PASS compileAndSerialize('(a + b) += c') is '(a + b) += c'
PASS compileAndSerialize('a + (b += c)') is 'a + (b += c)'
PASS compileAndSerialize('a -= b -= c') is 'a -= b -= c'
......@@ -276,7 +276,7 @@ PASS compileAndSerialize('a = (b -= c)') is 'a = (b -= c)'
PASS compileAndSerialize('a -= b + c') is 'a -= b + c'
PASS compileAndSerialize('(a -= b) + c') is '(a -= b) + c'
PASS compileAndSerialize('a -= (b + c)') is 'a -= (b + c)'
PASS compileAndSerialize('a + b -= c') threw exception SyntaxError: Unexpected token '-='.
PASS compileAndSerialize('a + b -= c') threw exception SyntaxError: Left hand sign of operator '-=' must be a reference..
PASS compileAndSerialize('(a + b) -= c') is '(a + b) -= c'
PASS compileAndSerialize('a + (b -= c)') is 'a + (b -= c)'
PASS compileAndSerialize('a <<= b <<= c') is 'a <<= b <<= c'
......@@ -288,7 +288,7 @@ PASS compileAndSerialize('a = (b <<= c)') is 'a = (b <<= c)'
PASS compileAndSerialize('a <<= b + c') is 'a <<= b + c'
PASS compileAndSerialize('(a <<= b) + c') is '(a <<= b) + c'
PASS compileAndSerialize('a <<= (b + c)') is 'a <<= (b + c)'
PASS compileAndSerialize('a + b <<= c') threw exception SyntaxError: Unexpected token '<<='.
PASS compileAndSerialize('a + b <<= c') threw exception SyntaxError: Left hand sign of operator '<<=' must be a reference..
PASS compileAndSerialize('(a + b) <<= c') is '(a + b) <<= c'
PASS compileAndSerialize('a + (b <<= c)') is 'a + (b <<= c)'
PASS compileAndSerialize('a >>= b >>= c') is 'a >>= b >>= c'
......@@ -300,7 +300,7 @@ PASS compileAndSerialize('a = (b >>= c)') is 'a = (b >>= c)'
PASS compileAndSerialize('a >>= b + c') is 'a >>= b + c'
PASS compileAndSerialize('(a >>= b) + c') is '(a >>= b) + c'
PASS compileAndSerialize('a >>= (b + c)') is 'a >>= (b + c)'
PASS compileAndSerialize('a + b >>= c') threw exception SyntaxError: Unexpected token '>>='.
PASS compileAndSerialize('a + b >>= c') threw exception SyntaxError: Left hand sign of operator '>>=' must be a reference..
PASS compileAndSerialize('(a + b) >>= c') is '(a + b) >>= c'
PASS compileAndSerialize('a + (b >>= c)') is 'a + (b >>= c)'
PASS compileAndSerialize('a >>>= b >>>= c') is 'a >>>= b >>>= c'
......@@ -312,7 +312,7 @@ PASS compileAndSerialize('a = (b >>>= c)') is 'a = (b >>>= c)'
PASS compileAndSerialize('a >>>= b + c') is 'a >>>= b + c'
PASS compileAndSerialize('(a >>>= b) + c') is '(a >>>= b) + c'
PASS compileAndSerialize('a >>>= (b + c)') is 'a >>>= (b + c)'
PASS compileAndSerialize('a + b >>>= c') threw exception SyntaxError: Unexpected token '>>>='.
PASS compileAndSerialize('a + b >>>= c') threw exception SyntaxError: Left hand sign of operator '>>>=' must be a reference..
PASS compileAndSerialize('(a + b) >>>= c') is '(a + b) >>>= c'
PASS compileAndSerialize('a + (b >>>= c)') is 'a + (b >>>= c)'
PASS compileAndSerialize('a &= b &= c') is 'a &= b &= c'
......@@ -324,7 +324,7 @@ PASS compileAndSerialize('a = (b &= c)') is 'a = (b &= c)'
PASS compileAndSerialize('a &= b + c') is 'a &= b + c'
PASS compileAndSerialize('(a &= b) + c') is '(a &= b) + c'
PASS compileAndSerialize('a &= (b + c)') is 'a &= (b + c)'
PASS compileAndSerialize('a + b &= c') threw exception SyntaxError: Unexpected token '&='.
PASS compileAndSerialize('a + b &= c') threw exception SyntaxError: Left hand sign of operator '&=' must be a reference..
PASS compileAndSerialize('(a + b) &= c') is '(a + b) &= c'
PASS compileAndSerialize('a + (b &= c)') is 'a + (b &= c)'
PASS compileAndSerialize('a ^= b ^= c') is 'a ^= b ^= c'
......@@ -336,7 +336,7 @@ PASS compileAndSerialize('a = (b ^= c)') is 'a = (b ^= c)'
PASS compileAndSerialize('a ^= b + c') is 'a ^= b + c'
PASS compileAndSerialize('(a ^= b) + c') is '(a ^= b) + c'
PASS compileAndSerialize('a ^= (b + c)') is 'a ^= (b + c)'
PASS compileAndSerialize('a + b ^= c') threw exception SyntaxError: Unexpected token '^='.
PASS compileAndSerialize('a + b ^= c') threw exception SyntaxError: Left hand sign of operator '^=' must be a reference..
PASS compileAndSerialize('(a + b) ^= c') is '(a + b) ^= c'
PASS compileAndSerialize('a + (b ^= c)') is 'a + (b ^= c)'
PASS compileAndSerialize('a |= b |= c') is 'a |= b |= c'
......@@ -348,7 +348,7 @@ PASS compileAndSerialize('a = (b |= c)') is 'a = (b |= c)'
PASS compileAndSerialize('a |= b + c') is 'a |= b + c'
PASS compileAndSerialize('(a |= b) + c') is '(a |= b) + c'
PASS compileAndSerialize('a |= (b + c)') is 'a |= (b + c)'
PASS compileAndSerialize('a + b |= c') threw exception SyntaxError: Unexpected token '|='.
PASS compileAndSerialize('a + b |= c') threw exception SyntaxError: Left hand sign of operator '|=' must be a reference..
PASS compileAndSerialize('(a + b) |= c') is '(a + b) |= c'
PASS compileAndSerialize('a + (b |= c)') is 'a + (b |= c)'
PASS compileAndSerialize('delete a + b') is 'delete a + b'
......
......@@ -4,32 +4,32 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
PASS L:{true;break L;false} is true
PASS if (0) { L:{ break; } } threw exception SyntaxError: 'break' is only valid inside a switch or loop statement.
PASS if (0) { L:{ continue L; } } threw exception SyntaxError: 'continue' is only valid inside a loop statement.
PASS if (0) { L:{ continue; } } threw exception SyntaxError: 'continue' is only valid inside a loop statement.
PASS if (0) { switch (1) { case 1: continue; } } threw exception SyntaxError: 'continue' is only valid inside a loop statement.
PASS if (0) { L:{ break; } } threw exception SyntaxError: 'break' is only valid inside a switch or loop statement..
PASS if (0) { L:{ continue L; } } threw exception SyntaxError: Cannot continue to the label 'L' as it is not targeting a loop..
PASS if (0) { L:{ continue; } } threw exception SyntaxError: 'continue' is only valid inside a loop statement..
PASS if (0) { switch (1) { case 1: continue; } } threw exception SyntaxError: 'continue' is only valid inside a loop statement..
PASS A:L:{true;break L;false} is true
PASS if (0) { A:L:{ break; } } threw exception SyntaxError: 'break' is only valid inside a switch or loop statement.
PASS if (0) { A:L:{ continue L; } } threw exception SyntaxError: 'continue' is only valid inside a loop statement.
PASS if (0) { A:L:{ continue; } } threw exception SyntaxError: 'continue' is only valid inside a loop statement.
PASS if (0) { A:L:{ break; } } threw exception SyntaxError: 'break' is only valid inside a switch or loop statement..
PASS if (0) { A:L:{ continue L; } } threw exception SyntaxError: Cannot continue to the label 'L' as it is not targeting a loop..
PASS if (0) { A:L:{ continue; } } threw exception SyntaxError: 'continue' is only valid inside a loop statement..
PASS L:A:{true;break L;false} is true
PASS if (0) { L:A:{ break; } } threw exception SyntaxError: 'break' is only valid inside a switch or loop statement.
PASS if (0) { L:A:{ continue L; } } threw exception SyntaxError: 'continue' is only valid inside a loop statement.
PASS if (0) { L:A:{ continue; } } threw exception SyntaxError: 'continue' is only valid inside a loop statement.
PASS if (0) { L:A:{ break; } } threw exception SyntaxError: 'break' is only valid inside a switch or loop statement..
PASS if (0) { L:A:{ continue L; } } threw exception SyntaxError: Cannot continue to the label 'L' as it is not targeting a loop..
PASS if (0) { L:A:{ continue; } } threw exception SyntaxError: 'continue' is only valid inside a loop statement..
PASS if(0){ L:for(;;) continue L; } is undefined.
PASS if(0){ L:A:for(;;) continue L; } is undefined.
PASS if(0){ A:L:for(;;) continue L; } is undefined.
PASS if(0){ A:for(;;) L:continue L; } threw exception SyntaxError: 'continue' is only valid inside a loop statement.
PASS if(0){ A:for(;;) L:continue L; } threw exception SyntaxError: Cannot continue to the label 'L' as it is not targeting a loop..
PASS if(0){ L:for(;;) A:continue L; } is undefined.
PASS if(0){ L:do continue L; while(0); } is undefined.
PASS if(0){ L:A:do continue L; while(0); } is undefined.
PASS if(0){ A:L:do continue L; while(0);} is undefined.
PASS if(0){ A:do L:continue L; while(0); } threw exception SyntaxError: 'continue' is only valid inside a loop statement.
PASS if(0){ A:do L:continue L; while(0); } threw exception SyntaxError: Cannot continue to the label 'L' as it is not targeting a loop..
PASS if(0){ L:do A:continue L; while(0); } is undefined.
PASS if(0){ L:while(0) continue L; } is undefined.
PASS if(0){ L:A:while(0) continue L; } is undefined.
PASS if(0){ A:L:while(0) continue L; } is undefined.
PASS if(0){ A:while(0) L:continue L; } threw exception SyntaxError: 'continue' is only valid inside a loop statement.
PASS if(0){ A:while(0) L:continue L; } threw exception SyntaxError: Cannot continue to the label 'L' as it is not targeting a loop..
PASS if(0){ L:while(0) A:continue L; } is undefined.
PASS successfullyParsed is true
......
CONSOLE MESSAGE: line 1: SyntaxError: Expected an identifier but found 'code' instead
CONSOLE MESSAGE: line 1: SyntaxError: Unexpected identifier 'code'
KDE JS Test
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
......
......@@ -7,14 +7,14 @@ PASS function test() { return;}; lab: 1 is 1
PASS function test() { while(0) break; } lab: 1 is 1
PASS function test() { while(0) continue; } lab: 1 is 1
PASS function test() { return lab;} lab: 1 is 1
PASS function test() { while(0) break lab; } lab: 1 threw exception SyntaxError: Label 'lab' is not defined.
PASS function test() { while(0) continue lab; } lab: 1 threw exception SyntaxError: Label 'lab' is not defined.
PASS function test() { while(0) break lab; } lab: 1 threw exception SyntaxError: Cannot use the undeclared label 'lab'..
PASS function test() { while(0) continue lab; } lab: 1 threw exception SyntaxError: Cannot use the undeclared label 'lab'..
PASS function test() { return } lab: 1 is 1
PASS function test() { while(0) break } lab: 1 is 1
PASS function test() { while(0) continue } lab: 1 is 1
PASS function test() { return 0 } lab: 1 is 1
PASS function test() { while(0) break lab } lab: 1 threw exception SyntaxError: Label 'lab' is not defined.
PASS function test() { while(0) continue lab } lab: 1 threw exception SyntaxError: Label 'lab' is not defined.
PASS function test() { while(0) break lab } lab: 1 threw exception SyntaxError: Cannot use the undeclared label 'lab'..
PASS function test() { while(0) continue lab } lab: 1 threw exception SyntaxError: Cannot use the undeclared label 'lab'..
PASS var éĀʯΈᢨ = 101; éĀʯΈᢨ; is 101
PASS var f÷; threw exception SyntaxError: Invalid character '\u0247'.
PASS var \u0061 = 102; a is 102
......
......@@ -3,8 +3,8 @@ Test to make sure we don't automatically insert semicolons at the end of a scrip
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS if (0) threw exception SyntaxError: Unexpected EOF.
PASS eval('if (0)') threw exception SyntaxError: Unexpected EOF.
PASS if (0) threw exception SyntaxError: Unexpected end of script.
PASS eval('if (0)') threw exception SyntaxError: Unexpected end of script.
PASS successfullyParsed is true
TEST COMPLETE
......
......@@ -3,20 +3,20 @@ Make sure that we correctly identify parse errors in object literals
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS ({a:1, get a(){}}) threw exception SyntaxError: Unexpected token '}'.
PASS ({a:1, set a(){}}) threw exception SyntaxError: Unexpected token '}'.
PASS ({get a(){}, a:1}) threw exception SyntaxError: Unexpected token '}'.
PASS ({set a(){}, a:1}) threw exception SyntaxError: Unexpected token '}'.
PASS ({get a(){}, get a(){}}) threw exception SyntaxError: Unexpected token '}'.
PASS ({set a(){}, set a(){}}) threw exception SyntaxError: Unexpected token '}'.
PASS ({set a(){}, get a(){}, set a(){}}) threw exception SyntaxError: Unexpected token '}'.
PASS (function(){({a:1, get a(){}})}) threw exception SyntaxError: Unexpected token '}'.
PASS (function(){({a:1, set a(){}})}) threw exception SyntaxError: Unexpected token '}'.
PASS (function(){({get a(){}, a:1})}) threw exception SyntaxError: Unexpected token '}'.
PASS (function(){({set a(){}, a:1})}) threw exception SyntaxError: Unexpected token '}'.
PASS (function(){({get a(){}, get a(){}})}) threw exception SyntaxError: Unexpected token '}'.
PASS (function(){({set a(){}, set a(){}})}) threw exception SyntaxError: Unexpected token '}'.
PASS (function(){({set a(){}, get a(){}, set a(){}})}) threw exception SyntaxError: Unexpected token '}'.
PASS ({a:1, get a(){}}) threw exception SyntaxError: Attempted to redefine property 'a'..
PASS ({a:1, set a(){}}) threw exception SyntaxError: Attempted to redefine property 'a'..
PASS ({get a(){}, a:1}) threw exception SyntaxError: Attempted to redefine property 'a'..
PASS ({set a(){}, a:1}) threw exception SyntaxError: Attempted to redefine property 'a'..
PASS ({get a(){}, get a(){}}) threw exception SyntaxError: Attempted to redefine property 'a'..
PASS ({set a(){}, set a(){}}) threw exception SyntaxError: Attempted to redefine property 'a'..
PASS ({set a(){}, get a(){}, set a(){}}) threw exception SyntaxError: Attempted to redefine property 'a'..
PASS (function(){({a:1, get a(){}})}) threw exception SyntaxError: Attempted to redefine property 'a'..
PASS (function(){({a:1, set a(){}})}) threw exception SyntaxError: Attempted to redefine property 'a'..
PASS (function(){({get a(){}, a:1})}) threw exception SyntaxError: Attempted to redefine property 'a'..
PASS (function(){({set a(){}, a:1})}) threw exception SyntaxError: Attempted to redefine property 'a'..
PASS (function(){({get a(){}, get a(){}})}) threw exception SyntaxError: Attempted to redefine property 'a'..
PASS (function(){({set a(){}, set a(){}})}) threw exception SyntaxError: Attempted to redefine property 'a'..
PASS (function(){({set a(){}, get a(){}, set a(){}})}) threw exception SyntaxError: Attempted to redefine property 'a'..
PASS ({a:1, a:1, a:1}), true is true
PASS ({get a(){}, set a(){}}), true is true
PASS ({set a(){}, get a(){}}), true is true
......
......@@ -3,9 +3,9 @@ Test to ensure correct handling of --> as a single line comment when at the begi
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS 'should be a syntax error' --> threw exception SyntaxError: Unexpected EOF.
PASS /**/ 1 --> threw exception SyntaxError: Unexpected EOF.
PASS 1 /**/ --> threw exception SyntaxError: Unexpected EOF.
PASS 'should be a syntax error' --> threw exception SyntaxError: Unexpected end of script.
PASS /**/ 1 --> threw exception SyntaxError: Unexpected end of script.
PASS 1 /**/ --> threw exception SyntaxError: Unexpected end of script.
PASS 1/*
*/--> threw exception SyntaxError: Unexpected token '>'.
PASS --> is undefined.
......
......@@ -4,9 +4,9 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
PASS !!/\)[;s]+/ is true
PASS /[/ threw exception SyntaxError: Unexpected token '/'.
PASS /[a/ threw exception SyntaxError: Unexpected token '/'.
PASS /[-/ threw exception SyntaxError: Unexpected token '/'.
PASS /[/ threw exception SyntaxError: Unexpected token '/'. Invalid regular expression..
PASS /[a/ threw exception SyntaxError: Unexpected token '/'. Invalid regular expression..
PASS /[-/ threw exception SyntaxError: Unexpected token '/'. Invalid regular expression..
PASS !!/(a)/ is true
PASS !!/(a){1,3}/ is true
PASS No crashes, yay!
......
......@@ -2,5 +2,5 @@ description(
"This test checks that the Function constructor detects some syntax errors correctly (bug#59795)."
);
shouldThrow("Function('(i + (j)')", '"SyntaxError: Expected token \')\'"');
shouldThrow("Function('return (i + (j)')", '"SyntaxError: Expected token \')\'"');
shouldThrow("Function('(i + (j)')", "\"SyntaxError: Unexpected token '}'. Expected ')' to end a compound expression.\"");
shouldThrow("Function('return (i + (j)')", "\"SyntaxError: Unexpected token '}'. Expected ')' to end a compound expression.\"");
......@@ -4,11 +4,13 @@ function isReserved(word)
eval("\"use strict\";var " + word + ";");
return false;
} catch (e) {
var expectedError = "Use of reserved word '" + word + "' in strict mode";
var expectedError = "Cannot use the reserved word '" + word + "' as a variable name in strict mode.";
if (expectedError == e.message)
return true;
else
else {
debug(e.message);
return false;
}
}
}
......
S7.3_A3.1_T2
PASS SyntaxError: Expected an identifier but found 'line' instead
PASS SyntaxError: Unexpected identifier 'line'
TEST COMPLETE
CONSOLE MESSAGE: line 77: SyntaxError: Expected an identifier but found 'comment' instead
CONSOLE MESSAGE: line 77: SyntaxError: Unexpected identifier 'comment'
S7.3_A3.1_T3
PASS Expected parsing failure
......
S7.3_A3.2_T2
PASS SyntaxError: Expected an identifier but found 'line' instead
PASS SyntaxError: Unexpected identifier 'line'
TEST COMPLETE
CONSOLE MESSAGE: line 78: SyntaxError: Expected an identifier but found 'comment' instead
CONSOLE MESSAGE: line 78: SyntaxError: Unexpected identifier 'comment'
S7.3_A3.2_T3
PASS Expected parsing failure
......
S7.3_A3.3_T2
PASS SyntaxError: Expected an identifier but found 'line' instead
PASS SyntaxError: Unexpected identifier 'line'
TEST COMPLETE
S7.3_A3.4_T2
PASS SyntaxError: Expected an identifier but found 'line' instead
PASS SyntaxError: Unexpected identifier 'line'
TEST COMPLETE
CONSOLE MESSAGE: line 79: SyntaxError: Unexpected token '/'
CONSOLE MESSAGE: line 79: SyntaxError: Unexpected token '/'. Invalid regular expression.
S7.4_A4_T1
PASS Expected parsing failure
......
CONSOLE MESSAGE: line 79: SyntaxError: Unexpected token '/'
CONSOLE MESSAGE: line 79: SyntaxError: Unexpected token '/'. Invalid regular expression.
S7.4_A4_T4
PASS Expected parsing failure
......
CONSOLE MESSAGE: line 76: SyntaxError: Expected an identifier but found '=' instead
CONSOLE MESSAGE: line 76: SyntaxError: Unexpected token '='. Expected an identifier as the target for a break statement.
S7.5.2_A1.1
PASS Expected parsing failure
......
CONSOLE MESSAGE: line 76: SyntaxError: Expected token '('
CONSOLE MESSAGE: line 76: SyntaxError: Unexpected token '='. Expected '(' to start a for-loop header.
S7.5.2_A1.10
PASS Expected parsing failure
......
CONSOLE MESSAGE: line 76: SyntaxError: Expected token '('
CONSOLE MESSAGE: line 76: SyntaxError: Unexpected token '='. Expected '(' to start a 'if' condition.
S7.5.2_A1.12
PASS Expected parsing failure
......
CONSOLE MESSAGE: line 76: SyntaxError: Unexpected token 'in'
CONSOLE MESSAGE: line 76: SyntaxError: Unexpected keyword 'in'
S7.5.2_A1.13
PASS Expected parsing failure
......
CONSOLE MESSAGE: line 76: SyntaxError: Unexpected token 'instanceof'
CONSOLE MESSAGE: line 76: SyntaxError: Unexpected keyword 'instanceof'
S7.5.2_A1.14
PASS Expected parsing failure
......
CONSOLE MESSAGE: line 76: SyntaxError: Return statements are only valid inside functions
CONSOLE MESSAGE: line 76: SyntaxError: Return statements are only valid inside functions.
S7.5.2_A1.16
PASS Expected parsing failure
......
CONSOLE MESSAGE: line 76: SyntaxError: Expected token '('
CONSOLE MESSAGE: line 76: SyntaxError: Unexpected token '='. Expected '(' to start a subject of a 'switch'.
S7.5.2_A1.17
PASS Expected parsing failure
......