Ignore:
Timestamp:
Jun 20, 2011, 10:49:34 AM (14 years ago)
Author:
[email protected]
Message:

2011-06-20 Juan C. Montemayor <[email protected]>

Reviewed by Oliver Hunt.

No context for javascript parse errors.
https://bugs.webkit.org/show_bug.cgi?id=62613

Ran 'run-webkit-tests --reset' with 'fast/js/' and 'sputnik' to update
those tests with the new parser error messages.

The test 'fast/js/script-tests/parser-syntax-check.js' was fixed to
not fail with the new parser error messages.

  • fast/dom/SelectorAPI/unknown-pseudo-expected.txt:
  • fast/dom/javascript-url-exception-isolation-expected.txt:
  • fast/encoding/meta-in-script-expected.txt:
  • fast/events/window-onerror5-expected.txt:
  • fast/events/window-onerror6-expected.txt:
  • fast/js/assign-expected.txt:
  • fast/js/basic-strict-mode-expected.txt:
  • fast/js/break-ASI-expected.txt:
  • fast/js/function-declaration-expected.txt:
  • fast/js/function-toString-object-literals-expected.txt:
  • fast/js/function-toString-parentheses-expected.txt:
  • fast/js/js-continue-break-restrictions-expected.txt:
  • fast/js/kde/garbage-n-expected.txt:
  • fast/js/kde/parse-expected.txt:
  • fast/js/kde/string-1-n-expected.txt:
  • fast/js/kde/string-2-n-expected.txt:
  • fast/js/mozilla/strict/12.14.1-expected.txt:
  • fast/js/mozilla/strict/13.1-expected.txt:
  • fast/js/mozilla/strict/regress-532254-expected.txt:
  • fast/js/no-semi-insertion-at-end-of-script-expected.txt:
  • fast/js/numeric-escapes-in-string-literals-expected.txt:
  • fast/js/object-extra-comma-expected.txt:
  • fast/js/object-literal-syntax-expected.txt:
  • fast/js/parser-xml-close-comment-expected.txt:
  • fast/js/postfix-syntax-expected.txt:
  • fast/js/regexp-compile-crash-expected.txt:
  • fast/js/removing-Cf-characters-expected.txt:
  • fast/js/reserved-words-as-property-expected.txt:
  • fast/js/script-tests/parser-syntax-check.js: (runTest):
  • fast/parser/entity-end-script-tag-expected.txt:
  • fast/regex/non-pattern-characters-expected.txt:
  • html5lib/runner-expected.txt:
  • http/tests/websocket/tests/bad-sub-protocol-control-chars-expected.txt:
  • http/tests/workers/shared-worker-importScripts-expected.txt:
  • http/tests/workers/worker-importScripts-expected.txt:
  • inspector/console/console-log-syntax-error-expected.txt:
  • inspector/debugger/debugger-autocontinue-on-syntax-error-expected.txt:
  • java/lc3/JavaObject/JavaObjectToBoolean-001-n-expected.txt:
  • loader/reload-subresource-when-type-changes-expected.txt:
  • platform/mac/fast/tokenizer/002-expected.txt:
  • platform/mac/fast/tokenizer/external-script-document-write_2-expected.txt:
  • platform/mac/fast/tokenizer/script_extra_close-expected.txt:
  • sputnik/Conformance/07_Lexical_Conventions/7.2_White_Space/S7.2_A5_T1-expected.txt:
  • sputnik/Conformance/07_Lexical_Conventions/7.2_White_Space/S7.2_A5_T2-expected.txt:
  • sputnik/Conformance/07_Lexical_Conventions/7.2_White_Space/S7.2_A5_T3-expected.txt:
  • sputnik/Conformance/07_Lexical_Conventions/7.2_White_Space/S7.2_A5_T4-expected.txt:
  • sputnik/Conformance/07_Lexical_Conventions/7.2_White_Space/S7.2_A5_T5-expected.txt:
  • sputnik/Conformance/07_Lexical_Conventions/7.3_Line_Terminators/S7.3_A2.1_T1-expected.txt:
  • sputnik/Conformance/07_Lexical_Conventions/7.3_Line_Terminators/S7.3_A2.1_T2-expected.txt:
  • sputnik/Conformance/07_Lexical_Conventions/7.3_Line_Terminators/S7.3_A2.2_T1-expected.txt:
  • sputnik/Conformance/07_Lexical_Conventions/7.3_Line_Terminators/S7.3_A2.2_T2-expected.txt:
  • sputnik/Conformance/07_Lexical_Conventions/7.3_Line_Terminators/S7.3_A2.3-expected.txt:
  • sputnik/Conformance/07_Lexical_Conventions/7.3_Line_Terminators/S7.3_A2.4-expected.txt:
  • 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.3_Line_Terminators/S7.3_A6_T1-expected.txt:
  • sputnik/Conformance/07_Lexical_Conventions/7.3_Line_Terminators/S7.3_A6_T2-expected.txt:
  • sputnik/Conformance/07_Lexical_Conventions/7.3_Line_Terminators/S7.3_A6_T3-expected.txt:
  • sputnik/Conformance/07_Lexical_Conventions/7.3_Line_Terminators/S7.3_A6_T4-expected.txt:
  • sputnik/Conformance/07_Lexical_Conventions/7.4_Comments/S7.4_A2_T2-expected.txt:
  • sputnik/Conformance/07_Lexical_Conventions/7.4_Comments/S7.4_A3-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.11-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.15-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.19-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.21-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.23-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.6-expected.txt:
  • sputnik/Conformance/07_Lexical_Conventions/7.5_Tokens/7.5.2_Keywords/S7.5.2_A1.7-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.7_Punctuators/S7.7_A2_T1-expected.txt:
  • sputnik/Conformance/07_Lexical_Conventions/7.7_Punctuators/S7.7_A2_T10-expected.txt:
  • sputnik/Conformance/07_Lexical_Conventions/7.7_Punctuators/S7.7_A2_T2-expected.txt:
  • sputnik/Conformance/07_Lexical_Conventions/7.7_Punctuators/S7.7_A2_T3-expected.txt:
  • sputnik/Conformance/07_Lexical_Conventions/7.7_Punctuators/S7.7_A2_T4-expected.txt:
  • sputnik/Conformance/07_Lexical_Conventions/7.7_Punctuators/S7.7_A2_T5-expected.txt:
  • sputnik/Conformance/07_Lexical_Conventions/7.7_Punctuators/S7.7_A2_T6-expected.txt:
  • sputnik/Conformance/07_Lexical_Conventions/7.7_Punctuators/S7.7_A2_T7-expected.txt:
  • sputnik/Conformance/07_Lexical_Conventions/7.7_Punctuators/S7.7_A2_T8-expected.txt:
  • sputnik/Conformance/07_Lexical_Conventions/7.7_Punctuators/S7.7_A2_T9-expected.txt:
  • sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.3_Numeric_Literals/S7.8.3_A6.1_T1-expected.txt:
  • sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.3_Numeric_Literals/S7.8.3_A6.1_T2-expected.txt:
  • sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.3_Numeric_Literals/S7.8.3_A6.2_T1-expected.txt:
  • sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.3_Numeric_Literals/S7.8.3_A6.2_T2-expected.txt:
  • sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.4_String_Literals/S7.8.4_A1.1_T1-expected.txt:
  • sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.4_String_Literals/S7.8.4_A1.1_T2-expected.txt:
  • sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.4_String_Literals/S7.8.4_A1.2_T1-expected.txt:
  • sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.4_String_Literals/S7.8.4_A1.2_T2-expected.txt:
  • sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.4_String_Literals/S7.8.4_A3.1_T1-expected.txt:
  • sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.4_String_Literals/S7.8.4_A3.1_T2-expected.txt:
  • sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.4_String_Literals/S7.8.4_A3.2_T1-expected.txt:
  • sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.4_String_Literals/S7.8.4_A3.2_T2-expected.txt:
  • sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.4_String_Literals/S7.8.4_A7.1_T4-expected.txt:
  • sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.4_String_Literals/S7.8.4_A7.2_T1-expected.txt:
  • sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.4_String_Literals/S7.8.4_A7.2_T2-expected.txt:
  • sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.4_String_Literals/S7.8.4_A7.2_T3-expected.txt:
  • sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.4_String_Literals/S7.8.4_A7.2_T4-expected.txt:
  • sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.4_String_Literals/S7.8.4_A7.2_T5-expected.txt:
  • sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.4_String_Literals/S7.8.4_A7.2_T6-expected.txt:
  • sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.5_Regular_Expression_Literals/S7.8.5_A1.2_T1-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.2_T3-expected.txt:
  • sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.5_Regular_Expression_Literals/S7.8.5_A1.2_T4-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.2_T2-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_T2-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_T6-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_A5.1_T1-expected.txt:
  • sputnik/Conformance/07_Lexical_Conventions/7.9_Automatic_Semicolon_Insertion/S7.9_A5.3_T1-expected.txt:
  • sputnik/Conformance/07_Lexical_Conventions/7.9_Automatic_Semicolon_Insertion/S7.9_A6.2_T1-expected.txt:
  • sputnik/Conformance/07_Lexical_Conventions/7.9_Automatic_Semicolon_Insertion/S7.9_A6.2_T10-expected.txt:
  • sputnik/Conformance/07_Lexical_Conventions/7.9_Automatic_Semicolon_Insertion/S7.9_A6.2_T2-expected.txt:
  • sputnik/Conformance/07_Lexical_Conventions/7.9_Automatic_Semicolon_Insertion/S7.9_A6.2_T3-expected.txt:
  • sputnik/Conformance/07_Lexical_Conventions/7.9_Automatic_Semicolon_Insertion/S7.9_A6.2_T4-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_T7-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_T1-expected.txt:
  • sputnik/Conformance/07_Lexical_Conventions/7.9_Automatic_Semicolon_Insertion/S7.9_A6.3_T2-expected.txt:
  • sputnik/Conformance/07_Lexical_Conventions/7.9_Automatic_Semicolon_Insertion/S7.9_A6.3_T3-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_A6.4_T2-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_T1-expected.txt:
  • sputnik/Conformance/08_Types/8.4_The_String_Type/S8.4_A13_T2-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_T1-expected.txt:
  • sputnik/Conformance/08_Types/8.4_The_String_Type/S8.4_A14_T2-expected.txt:
  • sputnik/Conformance/08_Types/8.4_The_String_Type/S8.4_A14_T3-expected.txt:
  • sputnik/Conformance/11_Expressions/11.2_Left_Hand_Side_Expressions/11.2.4_Argument_Lists/S11.2.4_A1.3_T1-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_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_T4-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_A8-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/13_Function_Definition/S13_A7_T3-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:

2011-06-20 Juan C. Montemayor <[email protected]>

Reviewed by Oliver Hunt.

No context for javascript parse errors.
https://bugs.webkit.org/show_bug.cgi?id=62613

Parse errors now show more details like:
"Unexpected token: ]"
or
"Expected token: while"

For reserved names, numbers, indentifiers, strings, lexer errors,
and EOFs, the following error messages are printed:

"Use of reserved word: super"
"Unexpected number: 42"
"Unexpected identifier: "
"Unexpected string: "foobar""
"Invalid token character sequence: \u4023"
"Unexpected EOF"

  • parser/JSParser.cpp: (JSC::JSParser::consume): (JSC::JSParser::getToken): (JSC::JSParser::getTokenName): (JSC::JSParser::updateErrorMessageSpecialCase): (JSC::JSParser::updateErrorMessage): (JSC::JSParser::updateErrorWithNameAndMessage): (JSC::jsParse): (JSC::JSParser::JSParser): (JSC::JSParser::parseProgram): (JSC::JSParser::parseVarDeclarationList): (JSC::JSParser::parseForStatement): (JSC::JSParser::parseBreakStatement): (JSC::JSParser::parseContinueStatement): (JSC::JSParser::parseWithStatement): (JSC::JSParser::parseTryStatement): (JSC::JSParser::parseStatement): (JSC::JSParser::parseFormalParameters): (JSC::JSParser::parseFunctionInfo): (JSC::JSParser::parseAssignmentExpression): (JSC::JSParser::parsePrimaryExpression): (JSC::JSParser::parseMemberExpression): (JSC::JSParser::parseUnaryExpression):
  • parser/JSParser.h:
  • parser/Lexer.cpp: (JSC::Lexer::lex):
  • parser/Parser.cpp: (JSC::Parser::parse):
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/parser/JSParser.cpp

    r88719 r89257  
    4444
    4545namespace JSC {
    46 #define fail() do { m_error = true; return 0; } while (0)
     46#define fail() do { if (!m_error) updateErrorMessage(); return 0; } while (0)
     47#define failWithToken(tok) do { if (!m_error) updateErrorMessage(tok); return 0; } while (0)
     48#define failWithMessage(msg) do { if (!m_error) updateErrorMessage(msg); return 0; } while (0)
     49#define failWithNameAndMessage(before, name, after) do { if (!m_error) updateErrorWithNameAndMessage(before, name, after); return 0; } while (0)
    4750#define failIfFalse(cond) do { if (!(cond)) fail(); } while (0)
     51#define failIfFalseWithMessage(cond, msg) do { if (!(cond)) failWithMessage(msg); } while (0)
     52#define failIfFalseWithNameAndMessage(cond, before, name, msg) do { if (!(cond)) failWithNameAndMessage(before, name, msg); } while (0)
    4853#define failIfTrue(cond) do { if ((cond)) fail(); } while (0)
     54#define failIfTrueWithMessage(cond, msg) do { if ((cond)) failWithMessage(msg); } while (0)
     55#define failIfTrueWithNameAndMessage(cond, before, name, msg) do { if ((cond)) failWithNameAndMessage(before, name, msg); } while (0)
    4956#define failIfTrueIfStrict(cond) do { if ((cond) && strictMode()) fail(); } while (0)
     57#define failIfTrueIfStrictWithMessage(cond, msg) do { if ((cond) && strictMode()) failWithMessage(msg); } while (0)
     58#define failIfTrueIfStrictWithNameAndMessage(cond, before, name, after) do { if ((cond) && strictMode()) failWithNameAndMessage(before, name, after); } while (0)
    5059#define failIfFalseIfStrict(cond) do { if ((!(cond)) && strictMode()) fail(); } while (0)
    51 #define consumeOrFail(tokenType) do { if (!consume(tokenType)) fail(); } while (0)
    52 #define consumeOrFailWithFlags(tokenType, flags) do { if (!consume(tokenType, flags)) fail(); } while (0)
    53 #define matchOrFail(tokenType) do { if (!match(tokenType)) fail(); } while (0)
    54 #define failIfStackOverflow() do { failIfFalse(canRecurse()); } while (0)
     60#define failIfFalseIfStrictWithMessage(cond, msg) do { if ((!(cond)) && strictMode()) failWithMessage(msg); } while (0)
     61#define failIfFalseIfStrictWithNameAndMessage(cond, before, name, after) do { if ((!(cond)) && strictMode()) failWithNameAndMessage(before, name, after); } while (0)
     62#define consumeOrFail(tokenType) do { if (!consume(tokenType)) failWithToken(tokenType); } while (0)
     63#define consumeOrFailWithFlags(tokenType, flags) do { if (!consume(tokenType, flags)) failWithToken(tokenType); } while (0)
     64#define matchOrFail(tokenType) do { if (!match(tokenType)) failWithToken(tokenType); } while (0)
     65#define failIfStackOverflow() do { failIfFalseWithMessage(canRecurse(), "Code nested too deeply."); } while (0)
    5566
    5667// Macros to make the more common TreeBuilder types a little less verbose
     
    7283class JSParser {
    7384public:
    74     JSParser(Lexer*, JSGlobalData*, FunctionParameters*, bool isStrictContext, bool isFunction, SourceProvider*);
    75     const char* parseProgram();
     85    JSParser(Lexer*, JSGlobalData*, FunctionParameters*, bool isStrictContext, bool isFunction, const SourceCode*);
     86    UString parseProgram();
    7687private:
    7788    struct AllowInOverride {
     
    124135    {
    125136        bool result = m_token.m_type == expected;
    126         failIfFalse(result);
    127         next(flags);
     137        if (result)
     138            next(flags);
    128139        return result;
    129140    }
    130141
     142    ALWAYS_INLINE UString getToken() {
     143        SourceProvider* sourceProvider = m_source->provider();
     144        return UString(sourceProvider->getRange(tokenStart(), tokenEnd()).impl());
     145    }
     146   
    131147    ALWAYS_INLINE bool match(JSTokenType expected)
    132148    {
     
    147163    {
    148164        return m_token.m_info.endOffset;
     165    }
     166   
     167    const char* getTokenName(JSTokenType tok)
     168    {
     169        switch (tok) {
     170        case NULLTOKEN:
     171            return "null";
     172        case TRUETOKEN:
     173            return "true";
     174        case FALSETOKEN:
     175            return "false";
     176        case BREAK:
     177            return "break";
     178        case CASE:
     179            return "case";
     180        case DEFAULT:
     181            return "defualt";
     182        case FOR:
     183            return "for";
     184        case NEW:
     185            return "new";
     186        case VAR:
     187            return "var";
     188        case CONSTTOKEN:
     189            return "const";
     190        case CONTINUE:
     191            return "continue";
     192        case FUNCTION:
     193            return "function";
     194        case RETURN:
     195            return 0;
     196        case IF:
     197            return "if";
     198        case THISTOKEN:
     199            return "this";
     200        case DO:
     201            return "do";
     202        case WHILE:
     203            return "while";
     204        case SWITCH:
     205            return "switch";
     206        case WITH:
     207            return "with";
     208        case RESERVED_IF_STRICT:
     209        case RESERVED:
     210            return 0;
     211        case THROW:
     212            return "throw";
     213        case TRY:
     214            return "try";
     215        case CATCH:
     216            return "catch";
     217        case FINALLY:
     218            return "finally";
     219        case DEBUGGER:
     220            return "debugger";
     221        case ELSE:
     222            return "else";
     223        case OPENBRACE:
     224            return "{";
     225        case CLOSEBRACE:
     226            return "}";
     227        case OPENPAREN:
     228            return "(";
     229        case CLOSEPAREN:
     230            return ")";
     231        case OPENBRACKET:
     232            return "[";
     233        case CLOSEBRACKET:
     234            return "]";
     235        case COMMA:
     236            return ",";
     237        case QUESTION:
     238            return "?";
     239        case NUMBER:
     240            return 0;
     241        case IDENT:
     242            return 0;
     243        case STRING:
     244            return 0;
     245        case SEMICOLON:
     246            return ";";
     247        case COLON:
     248            return ":";
     249        case DOT:
     250            return ".";
     251        case ERRORTOK:
     252            return 0;
     253        case EOFTOK:
     254            return 0;
     255        case EQUAL:
     256            return "=";
     257        case PLUSEQUAL:
     258            return "+=";
     259        case MINUSEQUAL:
     260            return "-=";
     261        case MULTEQUAL:
     262            return "*=";
     263        case DIVEQUAL:
     264            return "/=";
     265        case LSHIFTEQUAL:
     266            return "<<=";
     267        case RSHIFTEQUAL:
     268            return ">>=";
     269        case URSHIFTEQUAL:
     270            return ">>>=";
     271        case ANDEQUAL:
     272            return "&=";
     273        case MODEQUAL:
     274            return "%=";
     275        case XOREQUAL:
     276            return "^=";
     277        case OREQUAL:
     278            return "|=";
     279        case AUTOPLUSPLUS:
     280        case PLUSPLUS:
     281            return "++";
     282        case AUTOMINUSMINUS:
     283        case MINUSMINUS:
     284            return "--";
     285        case EXCLAMATION:
     286            return "!";
     287        case TILDE:
     288            return "~";
     289        case TYPEOF:
     290            return "typeof";
     291        case VOIDTOKEN:
     292            return "void";
     293        case DELETETOKEN:
     294            return "delete";
     295        case OR:
     296            return "||";
     297        case AND:
     298            return "&&";
     299        case BITOR:
     300            return "|";
     301        case BITXOR:
     302            return "^";
     303        case BITAND:
     304            return "&";
     305        case EQEQ:
     306            return "==";
     307        case NE:
     308            return "!=";
     309        case STREQ:
     310            return "===";
     311        case STRNEQ:
     312            return "!==";
     313        case LT:
     314            return "<";
     315        case GT:
     316            return ">";
     317        case LE:
     318            return "<=";
     319        case GE:
     320            return ">=";
     321        case INSTANCEOF:
     322            return "instanceof";
     323        case INTOKEN:
     324            return "in";
     325        case LSHIFT:
     326            return "<<";
     327        case RSHIFT:
     328            return ">>";
     329        case URSHIFT:
     330            return ">>>";
     331        case PLUS:
     332            return "+";
     333        case MINUS:
     334            return "-";
     335        case TIMES:
     336            return "*";
     337        case DIVIDE:
     338            return "/";
     339        case MOD:
     340            return "%";
     341        case LastUntaggedToken:
     342            break;
     343        }
     344        ASSERT_NOT_REACHED();
     345        return "internal error";
     346    }
     347   
     348    ALWAYS_INLINE void updateErrorMessageSpecialCase(JSTokenType expectedToken)
     349    {
     350        String errorMessage;
     351        switch (expectedToken) {
     352        case RESERVED:
     353            errorMessage = "Use of reserved word '";
     354            errorMessage += getToken().impl();
     355            errorMessage += "'";
     356            m_errorMessage = errorMessage.impl();
     357            return;
     358        case NUMBER:
     359            errorMessage = "Unexpected number '";
     360            errorMessage += getToken().impl();
     361            errorMessage += "'";
     362            m_errorMessage = errorMessage.impl();
     363            return;
     364        case IDENT:
     365            errorMessage = "Expected an identifier but found '";
     366            errorMessage += getToken().impl();
     367            errorMessage += "' instead";
     368            m_errorMessage = errorMessage.impl();
     369            return;
     370        case STRING:
     371            errorMessage = "Unexpected string ";
     372            errorMessage += getToken().impl();
     373            m_errorMessage = errorMessage.impl();
     374            return;
     375        case ERRORTOK:
     376            errorMessage = "Unrecognized token '";
     377            errorMessage += getToken().impl();
     378            errorMessage += "'";
     379            m_errorMessage = errorMessage.impl();
     380            return;
     381        case EOFTOK: 
     382            m_errorMessage = "Unexpected EOF";
     383            return;
     384        case RETURN:
     385            m_errorMessage = "Return statements are only valid inside functions";
     386            return;
     387        default:
     388            ASSERT_NOT_REACHED();
     389            m_errorMessage = "internal error";
     390            return;
     391        }
     392    }
     393       
     394    ALWAYS_INLINE void updateErrorMessage()
     395    {
     396        m_error = true;
     397        const char* name = getTokenName(m_token.m_type);
     398        if (!name)
     399            updateErrorMessageSpecialCase(m_token.m_type);
     400        else
     401            m_errorMessage = UString(String::format("Unexpected token '%s'", name).impl());
     402    }
     403   
     404    ALWAYS_INLINE void updateErrorMessage(JSTokenType expectedToken)
     405    {
     406        m_error = true;
     407        const char* name = getTokenName(expectedToken);
     408        if (!name)
     409            updateErrorMessageSpecialCase(expectedToken);
     410        else
     411            m_errorMessage = UString(String::format("Expected token '%s'", name).impl());
     412    }
     413   
     414    ALWAYS_INLINE void updateErrorWithNameAndMessage(const char* beforeMsg, UString name, const char* afterMsg)
     415    {
     416        m_error = true;
     417        String prefix(beforeMsg);
     418        String postfix(afterMsg);
     419        prefix += " '";
     420        prefix += name.impl();
     421        prefix += "' ";
     422        prefix += postfix;
     423        m_errorMessage = prefix.impl();
     424    }
     425   
     426    ALWAYS_INLINE void updateErrorMessage(const char* msg)
     427    {   
     428        m_error = true;
     429        m_errorMessage = UString(msg);
    149430    }
    150431   
     
    258539    StackBounds m_stack;
    259540    bool m_error;
    260     const char* m_errorMessage;
     541    UString m_errorMessage;
    261542    JSGlobalData* m_globalData;
    262543    JSToken m_token;
     
    616897
    617898    SourceProviderCache* m_functionCache;
     899    const SourceCode* m_source;
    618900};
    619901
    620 const char* jsParse(JSGlobalData* globalData, FunctionParameters* parameters, JSParserStrictness strictness, JSParserMode parserMode, const SourceCode* source)
    621 {
    622     JSParser parser(globalData->lexer, globalData, parameters, strictness == JSParseStrict, parserMode == JSParseFunctionCode, source->provider());
     902UString jsParse(JSGlobalData* globalData, FunctionParameters* parameters, JSParserStrictness strictness, JSParserMode parserMode, const SourceCode* source)
     903{
     904    JSParser parser(globalData->lexer, globalData, parameters, strictness == JSParseStrict, parserMode == JSParseFunctionCode, source);
    623905    return parser.parseProgram();
    624906}
    625907
    626 JSParser::JSParser(Lexer* lexer, JSGlobalData* globalData, FunctionParameters* parameters, bool inStrictContext, bool isFunction, SourceProvider* provider)
     908JSParser::JSParser(Lexer* lexer, JSGlobalData* globalData, FunctionParameters* parameters, bool inStrictContext, bool isFunction, const SourceCode* source)
    627909    : m_lexer(lexer)
    628910    , m_stack(globalData->stack())
     
    635917    , m_assignmentCount(0)
    636918    , m_nonLHSCount(0)
    637     , m_syntaxAlreadyValidated(provider->isValid())
     919    , m_syntaxAlreadyValidated(source->provider()->isValid())
    638920    , m_statementDepth(0)
    639921    , m_nonTrivialExpressionCount(0)
    640922    , m_lastIdentifier(0)
    641923    , m_functionCache(m_lexer->sourceProvider()->cache())
     924    , m_source(source)
    642925{
    643926    ScopeRef scope = pushScope();
     
    654937}
    655938
    656 const char* JSParser::parseProgram()
     939UString JSParser::parseProgram()
    657940{
    658941    unsigned oldFunctionCacheSize = m_functionCache ? m_functionCache->byteSize() : 0;
     
    678961    m_globalData->parser->didFinishParsing(sourceElements, context.varDeclarations(), context.funcDeclarations(), features,
    679962                                           m_lastLine, context.numConstants(), capturedVariables);
    680     return 0;
     963    return UString();
    681964}
    682965
     
    8011084        next();
    8021085        bool hasInitializer = match(EQUAL);
    803         failIfFalseIfStrict(declareVariable(name));
     1086        failIfFalseIfStrictWithNameAndMessage(declareVariable(name), "Cannot declare a variable named", name->impl(), "in strict mode.");
    8041087        context.addVar(name, (hasInitializer || (!m_allowsIn && match(INTOKEN))) ? DeclarationStacks::HasInitializer : 0);
    8051088        if (hasInitializer) {
     
    8851168        // Handle for-in with var declaration
    8861169        int inLocation = tokenStart();
    887         if (!consume(INTOKEN))
    888             fail();
     1170        consumeOrFail(INTOKEN);
    8891171
    8901172        TreeExpression expr = parseExpression(context);
     
    9671249
    9681250    if (autoSemiColon()) {
    969         failIfFalse(breakIsValid());
     1251        failIfFalseWithMessage(breakIsValid(), "'break' is only valid inside a switch or loop statement");
    9701252        return context.createBreakStatement(startCol, endCol, startLine, endLine);
    9711253    }
    9721254    matchOrFail(IDENT);
    9731255    const Identifier* ident = m_token.m_data.ident;
    974     failIfFalse(getLabel(ident));
     1256    failIfFalseWithNameAndMessage(getLabel(ident), "Label", ident->impl(), "is not defined");
    9751257    endCol = tokenEnd();
    9761258    endLine = tokenLine();
     
    9901272
    9911273    if (autoSemiColon()) {
    992         failIfFalse(continueIsValid());
     1274        failIfFalseWithMessage(continueIsValid(), "'continue' is only valid inside a loop statement");
    9931275        return context.createContinueStatement(startCol, endCol, startLine, endLine);
    9941276    }
     
    9961278    const Identifier* ident = m_token.m_data.ident;
    9971279    ScopeLabelInfo* label = getLabel(ident);
    998     failIfFalse(label);
    999     failIfFalse(label->m_isLoop);
     1280    failIfFalseWithNameAndMessage(label, "Label", ident->impl(), "is not defined");
     1281    failIfFalseWithMessage(label->m_isLoop, "'continue' is only valid inside a loop statement");
    10001282    endCol = tokenEnd();
    10011283    endLine = tokenLine();
     
    10511333{
    10521334    ASSERT(match(WITH));
    1053     failIfTrue(strictMode());
     1335    failIfTrueWithMessage(strictMode(), "'with' statements are not valid in strict mode");
    10541336    currentScope()->setNeedsFullActivation();
    10551337    int startLine = tokenLine();
     
    11591441        next();
    11601442        AutoPopScopeRef catchScope(this, pushScope());
    1161         failIfFalseIfStrict(catchScope->declareVariable(ident));
     1443        failIfFalseIfStrictWithNameAndMessage(catchScope->declareVariable(ident), "Cannot declare a variable named", ident->impl(), "in strict mode");
    11621444        catchScope->preventNewDecls();
    11631445        consumeOrFail(CLOSEPAREN);
     
    11651447        int initialEvalCount = context.evalCount();
    11661448        catchBlock = parseBlockStatement(context);
    1167         failIfFalse(catchBlock);
     1449        failIfFalseWithMessage(catchBlock, "'try' must have a catch or finally block");
    11681450        catchHasEval = initialEvalCount != context.evalCount();
    11691451        failIfFalse(popScope(catchScope, TreeBuilder::NeedsFreeVariableInfo));
     
    12231505        return parseConstDeclaration(context);
    12241506    case FUNCTION:
    1225         failIfFalseIfStrict(m_statementDepth == 1);
     1507        failIfFalseIfStrictWithMessage(m_statementDepth == 1, "Functions cannot be declared in a nested block in strict mode");
    12261508        return parseFunctionDeclaration(context);
    12271509    case SEMICOLON:
     
    12741556{
    12751557    matchOrFail(IDENT);
    1276     failIfFalseIfStrict(declareParameter(m_token.m_data.ident));
     1558    failIfFalseIfStrictWithNameAndMessage(declareParameter(m_token.m_data.ident), "Cannot declare a parameter named", m_token.m_data.ident->impl(), " in strict mode");
    12771559    TreeFormalParameterList list = context.createFormalParameterList(*m_token.m_data.ident);
    12781560    TreeFormalParameterList tail = list;
     
    12821564        matchOrFail(IDENT);
    12831565        const Identifier* ident = m_token.m_data.ident;
    1284         failIfFalseIfStrict(declareParameter(ident));
     1566        failIfFalseIfStrictWithNameAndMessage(declareParameter(ident), "Cannot declare a parameter named", ident->impl(), "in strict mode");
    12851567        next();
    12861568        tail = context.createFormalParameterList(tail, *ident);
     
    13061588    if (match(IDENT)) {
    13071589        name = m_token.m_data.ident;
    1308         failIfTrue(*name == m_globalData->propertyNames->underscoreProto);
     1590        failIfTrueWithMessage(*name == m_globalData->propertyNames->underscoreProto, "Cannot name a function __proto__");
    13091591        next();
    13101592        if (!nameIsInContainingScope)
     
    13441626    failIfFalse(body);
    13451627    if (functionScope->strictMode() && name) {
    1346         failIfTrue(m_globalData->propertyNames->arguments == *name);
    1347         failIfTrue(m_globalData->propertyNames->eval == *name);
     1628        failIfTrueWithNameAndMessage(m_globalData->propertyNames->arguments == *name, "Function name", name->impl(), "is not valid in strict mode");
     1629        failIfTrueWithNameAndMessage(m_globalData->propertyNames->eval == *name, "Function name", name->impl(), "is not valid in strict mode");
    13481630    }
    13491631    closeBracePos = m_token.m_data.intValue;
     
    16091891        next(TreeBuilder::DontBuildStrings);
    16101892        if (strictMode() && m_lastIdentifier && context.isResolve(lhs)) {
    1611             failIfTrueIfStrict(m_globalData->propertyNames->eval == *m_lastIdentifier);
    1612             failIfTrueIfStrict(m_globalData->propertyNames->arguments == *m_lastIdentifier);
     1893            failIfTrueIfStrictWithMessage(m_globalData->propertyNames->eval == *m_lastIdentifier, "'eval' cannot be modified in strict mode");
     1894            failIfTrueIfStrictWithMessage(m_globalData->propertyNames->arguments == *m_lastIdentifier, "'arguments' cannot be modified in strict mode");
    16131895            declareWrite(m_lastIdentifier);
    16141896            m_lastIdentifier = 0;
     
    19492231        TreeExpression re = context.createRegExp(*pattern, *flags, start);
    19502232        if (!re) {
    1951             m_errorMessage = Yarr::checkSyntax(pattern->ustring());
    1952             ASSERT(m_errorMessage);
    1953             fail();
     2233            const char* yarrErrorMsg = Yarr::checkSyntax(pattern->ustring());
     2234            ASSERT(!m_errorMessage.isNull());
     2235            failWithMessage(yarrErrorMsg);
    19542236        }
    19552237        return re;
     
    20182300            failIfFalse(property);
    20192301            base = context.createBracketAccess(base, property, initialAssignments != m_assignmentCount, expressionStart, expressionEnd, tokenEnd());
    2020             if (!consume(CLOSEBRACKET))
    2021                 fail();
     2302            consumeOrFail(CLOSEBRACKET);
    20222303            m_nonLHSCount = nonLHSCount;
    20232304            break;
     
    21042385        }
    21052386    }
    2106     failIfTrueIfStrict(isEvalOrArguments && modifiesExpr);
     2387    failIfTrueIfStrictWithNameAndMessage(isEvalOrArguments && modifiesExpr, "'", m_lastIdentifier->impl(), "' cannot be modified in strict mode");
    21072388    switch (m_token.m_type) {
    21082389    case PLUSPLUS:
     
    21112392        expr = context.makePostfixNode(expr, OpPlusPlus, subExprStart, lastTokenEnd(), tokenEnd());
    21122393        m_assignmentCount++;
    2113         failIfTrueIfStrict(isEvalOrArguments);
     2394        failIfTrueIfStrictWithNameAndMessage(isEvalOrArguments, "'", m_lastIdentifier->impl(), "' cannot be modified in strict mode");
    21142395        failIfTrueIfStrict(requiresLExpr);
    21152396        next();
     
    21202401        expr = context.makePostfixNode(expr, OpMinusMinus, subExprStart, lastTokenEnd(), tokenEnd());
    21212402        m_assignmentCount++;
    2122         failIfTrueIfStrict(isEvalOrArguments);
     2403        failIfTrueIfStrictWithNameAndMessage(isEvalOrArguments, "'", m_lastIdentifier->impl(), "' cannot be modified in strict mode");
    21232404        failIfTrueIfStrict(requiresLExpr);
    21242405        next();
     
    21642445            break;
    21652446        case DELETETOKEN:
    2166             failIfTrueIfStrict(context.isResolve(expr));
     2447            failIfTrueIfStrictWithNameAndMessage(context.isResolve(expr), "Cannot delete unqualified property", m_lastIdentifier->impl(), "in strict mode");
    21672448            expr = context.makeDeleteNode(expr, context.unaryTokenStackLastStart(tokenStackDepth), end, end);
    21682449            break;
Note: See TracChangeset for help on using the changeset viewer.