Title: [90535] trunk
Revision
90535
Author
[email protected]
Date
2011-07-06 21:20:06 -0700 (Wed, 06 Jul 2011)

Log Message

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

        ASSERT_NOT_REACHED running test 262
        https://bugs.webkit.org/show_bug.cgi?id=63951

        Added a test to check compliance with reserved words in strict mode.
        Updated test results.

        Reviewed by Gavin Barraclough.

        * fast/js/kde/parse-expected.txt:
        * fast/js/reserved-words-as-property-expected.txt:
        * fast/js/reserved-words-strict-expected.txt: Added.
        * fast/js/reserved-words-strict.html: Added.
        * fast/js/script-tests/reserved-words-strict.js: Added.
        (isReserved):
        * platform/chromium/fast/js/reserved-words-strict-expected.txt: Added.
        * 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_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/12_Statement/12.14_The_try_Statement/S12.14_A16_T13-expected.txt:
2011-07-06  Juan C. Montemayor  <[email protected]>

        ASSERT_NOT_REACHED running test 262
        https://bugs.webkit.org/show_bug.cgi?id=63951

        Added a case to the switch statement where the code was failing. Fixed
        some logic as well that gave faulty error messages.

        Reviewed by Gavin Barraclough.

        * parser/JSParser.cpp:
        (JSC::JSParser::getTokenName):
        (JSC::JSParser::updateErrorMessageSpecialCase):
        (JSC::JSParser::updateErrorMessage):

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (90534 => 90535)


--- trunk/LayoutTests/ChangeLog	2011-07-07 04:11:33 UTC (rev 90534)
+++ trunk/LayoutTests/ChangeLog	2011-07-07 04:20:06 UTC (rev 90535)
@@ -1,3 +1,31 @@
+2011-07-06  Juan C. Montemayor  <[email protected]>
+
+        ASSERT_NOT_REACHED running test 262
+        https://bugs.webkit.org/show_bug.cgi?id=63951
+        
+        Added a test to check compliance with reserved words in strict mode. 
+        Updated test results.
+
+        Reviewed by Gavin Barraclough.
+
+        * fast/js/kde/parse-expected.txt:
+        * fast/js/reserved-words-as-property-expected.txt:
+        * fast/js/reserved-words-strict-expected.txt: Added.
+        * fast/js/reserved-words-strict.html: Added.
+        * fast/js/script-tests/reserved-words-strict.js: Added.
+        (isReserved):
+        * platform/chromium/fast/js/reserved-words-strict-expected.txt: Added.
+        * 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_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/12_Statement/12.14_The_try_Statement/S12.14_A16_T13-expected.txt:
+
 2011-07-06  Johnny Ding  <[email protected]>
 
         https://bugs.webkit.org/show_bug.cgi?id=63857

Modified: trunk/LayoutTests/fast/js/kde/parse-expected.txt (90534 => 90535)


--- trunk/LayoutTests/fast/js/kde/parse-expected.txt	2011-07-07 04:11:33 UTC (rev 90534)
+++ trunk/LayoutTests/fast/js/kde/parse-expected.txt	2011-07-07 04:20:06 UTC (rev 90535)
@@ -20,9 +20,9 @@
 PASS var \u0061 = 102; a is 102
 PASS var f\u0030 = 103; f0 is 103
 PASS var \u00E9\u0100\u02AF\u0388\u18A8 = 104; \u00E9\u0100\u02AF\u0388\u18A8; is 104
-PASS var f\u00F7; threw exception SyntaxError: Expected an identifier but found 'f\u00F7' instead.
-PASS var \u0030; threw exception SyntaxError: Expected an identifier but found '\u0030' instead.
-PASS var test = { }; test.i= 0; test.i\u002b= 1; test.i; threw exception SyntaxError: Expected an identifier but found 'i\u002b' instead.
+PASS var f\u00F7; threw exception SyntaxError: Unrecognized token 'f\u00F7'.
+PASS var \u0030; threw exception SyntaxError: Unrecognized token '\u0030'.
+PASS var test = { }; test.i= 0; test.i\u002b= 1; test.i; threw exception SyntaxError: Unrecognized token 'i\u002b'.
 PASS var test = { }; test.i= 0; test.i+= 1; test.i; is 1
 PASS successfullyParsed is true
 

Modified: trunk/LayoutTests/fast/js/reserved-words-as-property-expected.txt (90534 => 90535)


--- trunk/LayoutTests/fast/js/reserved-words-as-property-expected.txt	2011-07-07 04:11:33 UTC (rev 90534)
+++ trunk/LayoutTests/fast/js/reserved-words-as-property-expected.txt	2011-07-07 04:20:06 UTC (rev 90535)
@@ -155,12 +155,12 @@
 PASS (function(){try{}catch(new){}}) threw exception SyntaxError: Expected an identifier but found 'new' instead.
 PASS function new(){} threw exception SyntaxError: Unexpected token 'new'.
 PASS (function(){function new(){}}) threw exception SyntaxError: Unexpected token 'new'.
-PASS var return threw exception SyntaxError: Expected an identifier but found 'return' instead.
-PASS (function(){var return}) threw exception SyntaxError: Expected an identifier but found 'return' instead.
-PASS function g(return){} threw exception SyntaxError: Expected an identifier but found 'return' instead.
-PASS (function(){function g(return){}}) threw exception SyntaxError: Expected an identifier but found 'return' instead.
-PASS try{}catch(return){} threw exception SyntaxError: Expected an identifier but found 'return' instead.
-PASS (function(){try{}catch(return){}}) threw exception SyntaxError: Expected an identifier but found 'return' instead.
+PASS var return threw exception SyntaxError: Return statements are only valid inside functions.
+PASS (function(){var return}) threw exception SyntaxError: Return statements are only valid inside functions.
+PASS function g(return){} threw exception SyntaxError: Return statements are only valid inside functions.
+PASS (function(){function g(return){}}) threw exception SyntaxError: Return statements are only valid inside functions.
+PASS try{}catch(return){} threw exception SyntaxError: Return statements are only valid inside functions.
+PASS (function(){try{}catch(return){}}) threw exception SyntaxError: Return statements are only valid inside functions.
 PASS function return(){} threw exception SyntaxError: Return statements are only valid inside functions.
 PASS (function(){function return(){}}) threw exception SyntaxError: Return statements are only valid inside functions.
 PASS var switch threw exception SyntaxError: Expected an identifier but found 'switch' instead.
@@ -235,12 +235,12 @@
 PASS (function(){try{}catch(with){}}) threw exception SyntaxError: Expected an identifier but found 'with' instead.
 PASS function with(){} threw exception SyntaxError: Unexpected token 'with'.
 PASS (function(){function with(){}}) threw exception SyntaxError: Unexpected token 'with'.
-PASS var class threw exception SyntaxError: Expected an identifier but found 'class' instead.
-PASS (function(){var class}) threw exception SyntaxError: Expected an identifier but found 'class' instead.
-PASS function g(class){} threw exception SyntaxError: Expected an identifier but found 'class' instead.
-PASS (function(){function g(class){}}) threw exception SyntaxError: Expected an identifier but found 'class' instead.
-PASS try{}catch(class){} threw exception SyntaxError: Expected an identifier but found 'class' instead.
-PASS (function(){try{}catch(class){}}) threw exception SyntaxError: Expected an identifier but found 'class' instead.
+PASS var class threw exception SyntaxError: Use of reserved word 'class'.
+PASS (function(){var class}) threw exception SyntaxError: Use of reserved word 'class'.
+PASS function g(class){} threw exception SyntaxError: Use of reserved word 'class'.
+PASS (function(){function g(class){}}) threw exception SyntaxError: Use of reserved word 'class'.
+PASS try{}catch(class){} threw exception SyntaxError: Use of reserved word 'class'.
+PASS (function(){try{}catch(class){}}) threw exception SyntaxError: Use of reserved word 'class'.
 PASS function class(){} threw exception SyntaxError: Use of reserved word 'class'.
 PASS (function(){function class(){}}) threw exception SyntaxError: Use of reserved word 'class'.
 PASS var const threw exception SyntaxError: Expected an identifier but found 'const' instead.
@@ -251,44 +251,44 @@
 PASS (function(){try{}catch(const){}}) threw exception SyntaxError: Expected an identifier but found 'const' instead.
 PASS function const(){} threw exception SyntaxError: Unexpected token 'const'.
 PASS (function(){function const(){}}) threw exception SyntaxError: Unexpected token 'const'.
-PASS var enum threw exception SyntaxError: Expected an identifier but found 'enum' instead.
-PASS (function(){var enum}) threw exception SyntaxError: Expected an identifier but found 'enum' instead.
-PASS function g(enum){} threw exception SyntaxError: Expected an identifier but found 'enum' instead.
-PASS (function(){function g(enum){}}) threw exception SyntaxError: Expected an identifier but found 'enum' instead.
-PASS try{}catch(enum){} threw exception SyntaxError: Expected an identifier but found 'enum' instead.
-PASS (function(){try{}catch(enum){}}) threw exception SyntaxError: Expected an identifier but found 'enum' instead.
+PASS var enum threw exception SyntaxError: Use of reserved word 'enum'.
+PASS (function(){var enum}) threw exception SyntaxError: Use of reserved word 'enum'.
+PASS function g(enum){} threw exception SyntaxError: Use of reserved word 'enum'.
+PASS (function(){function g(enum){}}) threw exception SyntaxError: Use of reserved word 'enum'.
+PASS try{}catch(enum){} threw exception SyntaxError: Use of reserved word 'enum'.
+PASS (function(){try{}catch(enum){}}) threw exception SyntaxError: Use of reserved word 'enum'.
 PASS function enum(){} threw exception SyntaxError: Use of reserved word 'enum'.
 PASS (function(){function enum(){}}) threw exception SyntaxError: Use of reserved word 'enum'.
-PASS var export threw exception SyntaxError: Expected an identifier but found 'export' instead.
-PASS (function(){var export}) threw exception SyntaxError: Expected an identifier but found 'export' instead.
-PASS function g(export){} threw exception SyntaxError: Expected an identifier but found 'export' instead.
-PASS (function(){function g(export){}}) threw exception SyntaxError: Expected an identifier but found 'export' instead.
-PASS try{}catch(export){} threw exception SyntaxError: Expected an identifier but found 'export' instead.
-PASS (function(){try{}catch(export){}}) threw exception SyntaxError: Expected an identifier but found 'export' instead.
+PASS var export threw exception SyntaxError: Use of reserved word 'export'.
+PASS (function(){var export}) threw exception SyntaxError: Use of reserved word 'export'.
+PASS function g(export){} threw exception SyntaxError: Use of reserved word 'export'.
+PASS (function(){function g(export){}}) threw exception SyntaxError: Use of reserved word 'export'.
+PASS try{}catch(export){} threw exception SyntaxError: Use of reserved word 'export'.
+PASS (function(){try{}catch(export){}}) threw exception SyntaxError: Use of reserved word 'export'.
 PASS function export(){} threw exception SyntaxError: Use of reserved word 'export'.
 PASS (function(){function export(){}}) threw exception SyntaxError: Use of reserved word 'export'.
-PASS var extends threw exception SyntaxError: Expected an identifier but found 'extends' instead.
-PASS (function(){var extends}) threw exception SyntaxError: Expected an identifier but found 'extends' instead.
-PASS function g(extends){} threw exception SyntaxError: Expected an identifier but found 'extends' instead.
-PASS (function(){function g(extends){}}) threw exception SyntaxError: Expected an identifier but found 'extends' instead.
-PASS try{}catch(extends){} threw exception SyntaxError: Expected an identifier but found 'extends' instead.
-PASS (function(){try{}catch(extends){}}) threw exception SyntaxError: Expected an identifier but found 'extends' instead.
+PASS var extends threw exception SyntaxError: Use of reserved word 'extends'.
+PASS (function(){var extends}) threw exception SyntaxError: Use of reserved word 'extends'.
+PASS function g(extends){} threw exception SyntaxError: Use of reserved word 'extends'.
+PASS (function(){function g(extends){}}) threw exception SyntaxError: Use of reserved word 'extends'.
+PASS try{}catch(extends){} threw exception SyntaxError: Use of reserved word 'extends'.
+PASS (function(){try{}catch(extends){}}) threw exception SyntaxError: Use of reserved word 'extends'.
 PASS function extends(){} threw exception SyntaxError: Use of reserved word 'extends'.
 PASS (function(){function extends(){}}) threw exception SyntaxError: Use of reserved word 'extends'.
-PASS var import threw exception SyntaxError: Expected an identifier but found 'import' instead.
-PASS (function(){var import}) threw exception SyntaxError: Expected an identifier but found 'import' instead.
-PASS function g(import){} threw exception SyntaxError: Expected an identifier but found 'import' instead.
-PASS (function(){function g(import){}}) threw exception SyntaxError: Expected an identifier but found 'import' instead.
-PASS try{}catch(import){} threw exception SyntaxError: Expected an identifier but found 'import' instead.
-PASS (function(){try{}catch(import){}}) threw exception SyntaxError: Expected an identifier but found 'import' instead.
+PASS var import threw exception SyntaxError: Use of reserved word 'import'.
+PASS (function(){var import}) threw exception SyntaxError: Use of reserved word 'import'.
+PASS function g(import){} threw exception SyntaxError: Use of reserved word 'import'.
+PASS (function(){function g(import){}}) threw exception SyntaxError: Use of reserved word 'import'.
+PASS try{}catch(import){} threw exception SyntaxError: Use of reserved word 'import'.
+PASS (function(){try{}catch(import){}}) threw exception SyntaxError: Use of reserved word 'import'.
 PASS function import(){} threw exception SyntaxError: Use of reserved word 'import'.
 PASS (function(){function import(){}}) threw exception SyntaxError: Use of reserved word 'import'.
-PASS var super threw exception SyntaxError: Expected an identifier but found 'super' instead.
-PASS (function(){var super}) threw exception SyntaxError: Expected an identifier but found 'super' instead.
-PASS function g(super){} threw exception SyntaxError: Expected an identifier but found 'super' instead.
-PASS (function(){function g(super){}}) threw exception SyntaxError: Expected an identifier but found 'super' instead.
-PASS try{}catch(super){} threw exception SyntaxError: Expected an identifier but found 'super' instead.
-PASS (function(){try{}catch(super){}}) threw exception SyntaxError: Expected an identifier but found 'super' instead.
+PASS var super threw exception SyntaxError: Use of reserved word 'super'.
+PASS (function(){var super}) threw exception SyntaxError: Use of reserved word 'super'.
+PASS function g(super){} threw exception SyntaxError: Use of reserved word 'super'.
+PASS (function(){function g(super){}}) threw exception SyntaxError: Use of reserved word 'super'.
+PASS try{}catch(super){} threw exception SyntaxError: Use of reserved word 'super'.
+PASS (function(){try{}catch(super){}}) threw exception SyntaxError: Use of reserved word 'super'.
 PASS function super(){} threw exception SyntaxError: Use of reserved word 'super'.
 PASS (function(){function super(){}}) threw exception SyntaxError: Use of reserved word 'super'.
 PASS (obj=({true: true,false: true,null: true,break: true,case: true,catch: true,continue: true,debugger: true,default: true,delete: true,do: true,else: true,finally: true,for: true,function: true,if: true,in: true,instanceof: true,new: true,return: true,switch: true,this: true,throw: true,try: true,typeof: true,var: true,void: true,while: true,with: true,class: true,const: true,enum: true,export: true,extends: true,import: true,super: true, parsed: true })).parsed is true

Added: trunk/LayoutTests/fast/js/reserved-words-strict-expected.txt (0 => 90535)


--- trunk/LayoutTests/fast/js/reserved-words-strict-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/js/reserved-words-strict-expected.txt	2011-07-07 04:20:06 UTC (rev 90535)
@@ -0,0 +1,38 @@
+This file checks which ECMAScript 3 keywords are treated as reserved words in strict mode.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+SHOULD BE RESERVED:
+PASS isReserved('implements') is true
+PASS isReserved('interface') is true
+PASS isReserved('let') is true
+PASS isReserved('package') is true
+PASS isReserved('private') is true
+PASS isReserved('protected') is true
+PASS isReserved('public') is true
+PASS isReserved('static') is true
+PASS isReserved('yield') is true
+
+SHOULD NOT BE RESERVED:
+PASS isReserved('abstract') is false
+PASS isReserved('boolean') is false
+PASS isReserved('byte') is false
+PASS isReserved('char') is false
+PASS isReserved('double') is false
+PASS isReserved('final') is false
+PASS isReserved('float') is false
+PASS isReserved('goto') is false
+PASS isReserved('int') is false
+PASS isReserved('long') is false
+PASS isReserved('native') is false
+PASS isReserved('short') is false
+PASS isReserved('synchronized') is false
+PASS isReserved('throws') is false
+PASS isReserved('transient') is false
+PASS isReserved('volatile') is false
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/fast/js/reserved-words-strict.html (0 => 90535)


--- trunk/LayoutTests/fast/js/reserved-words-strict.html	                        (rev 0)
+++ trunk/LayoutTests/fast/js/reserved-words-strict.html	2011-07-07 04:20:06 UTC (rev 90535)
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href=""
+<script src=""
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src=""
+<script src=""
+</body>
+</html>

Added: trunk/LayoutTests/fast/js/script-tests/reserved-words-strict.js (0 => 90535)


--- trunk/LayoutTests/fast/js/script-tests/reserved-words-strict.js	                        (rev 0)
+++ trunk/LayoutTests/fast/js/script-tests/reserved-words-strict.js	2011-07-07 04:20:06 UTC (rev 90535)
@@ -0,0 +1,67 @@
+function isReserved(word)
+{
+    try {
+        eval("\"use strict\";var " + word + ";");
+        return false;
+    } catch (e) {
+    	var expectedError = "Use of reserved word '" + word + "' in strict mode";
+    	if (expectedError == e.message)
+        	return true;
+        else
+        	return false;
+    }
+}
+
+var reservedWords = [
+    "implements",
+    "let",
+    "private",
+    "public",
+    "yield",
+    "interface",
+    "package",
+    "protected",
+    "static"
+];
+
+var unreservedWords = [
+    "abstract",
+    "boolean",
+    "byte",
+    "char",
+    "double",
+    "final",
+    "float",
+    "goto",
+    "int",
+    "long",
+    "native",
+    "short",
+    "synchronized",
+    "throws",
+    "transient",
+    "volatile"
+];
+
+description(
+"This file checks which ECMAScript 3 keywords are treated as reserved words in strict mode."
+);
+
+reservedWords.sort();
+unreservedWords.sort();
+
+debug("SHOULD BE RESERVED:");
+for (var p in reservedWords) {
+    shouldBeTrue("isReserved('" + reservedWords[p] + "')");
+}
+
+debug("");
+
+debug("SHOULD NOT BE RESERVED:");
+for (var p in unreservedWords) {
+    shouldBeFalse("isReserved('" + unreservedWords[p] + "')");
+}
+
+debug("");
+
+var successfullyParsed = true;

Added: trunk/LayoutTests/platform/chromium/fast/js/reserved-words-strict-expected.txt (0 => 90535)


--- trunk/LayoutTests/platform/chromium/fast/js/reserved-words-strict-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/chromium/fast/js/reserved-words-strict-expected.txt	2011-07-07 04:20:06 UTC (rev 90535)
@@ -0,0 +1,38 @@
+This file checks which ECMAScript 3 keywords are treated as reserved words in strict mode.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+SHOULD BE RESERVED:
+FAIL isReserved('implements') should be true. Was false.
+FAIL isReserved('interface') should be true. Was false.
+FAIL isReserved('let') should be true. Was false.
+FAIL isReserved('package') should be true. Was false.
+FAIL isReserved('private') should be true. Was false.
+FAIL isReserved('protected') should be true. Was false.
+FAIL isReserved('public') should be true. Was false.
+FAIL isReserved('static') should be true. Was false.
+FAIL isReserved('yield') should be true. Was false.
+
+SHOULD NOT BE RESERVED:
+PASS isReserved('abstract') is false
+PASS isReserved('boolean') is false
+PASS isReserved('byte') is false
+PASS isReserved('char') is false
+PASS isReserved('double') is false
+PASS isReserved('final') is false
+PASS isReserved('float') is false
+PASS isReserved('goto') is false
+PASS isReserved('int') is false
+PASS isReserved('long') is false
+PASS isReserved('native') is false
+PASS isReserved('short') is false
+PASS isReserved('synchronized') is false
+PASS isReserved('throws') is false
+PASS isReserved('transient') is false
+PASS isReserved('volatile') is false
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Modified: trunk/LayoutTests/sputnik/Conformance/07_Lexical_Conventions/7.2_White_Space/S7.2_A5_T1-expected.txt (90534 => 90535)


--- trunk/LayoutTests/sputnik/Conformance/07_Lexical_Conventions/7.2_White_Space/S7.2_A5_T1-expected.txt	2011-07-07 04:11:33 UTC (rev 90534)
+++ trunk/LayoutTests/sputnik/Conformance/07_Lexical_Conventions/7.2_White_Space/S7.2_A5_T1-expected.txt	2011-07-07 04:20:06 UTC (rev 90535)
@@ -1,4 +1,4 @@
-CONSOLE MESSAGE: line 76: SyntaxError: Expected an identifier but found '\u0009' instead
+CONSOLE MESSAGE: line 76: SyntaxError: Unrecognized token '\u0009'
 S7.2_A5_T1
 
 PASS Expected parsing failure

Modified: trunk/LayoutTests/sputnik/Conformance/07_Lexical_Conventions/7.2_White_Space/S7.2_A5_T2-expected.txt (90534 => 90535)


--- trunk/LayoutTests/sputnik/Conformance/07_Lexical_Conventions/7.2_White_Space/S7.2_A5_T2-expected.txt	2011-07-07 04:11:33 UTC (rev 90534)
+++ trunk/LayoutTests/sputnik/Conformance/07_Lexical_Conventions/7.2_White_Space/S7.2_A5_T2-expected.txt	2011-07-07 04:20:06 UTC (rev 90535)
@@ -1,4 +1,4 @@
-CONSOLE MESSAGE: line 76: SyntaxError: Expected an identifier but found '\u000B' instead
+CONSOLE MESSAGE: line 76: SyntaxError: Unrecognized token '\u000B'
 S7.2_A5_T2
 
 PASS Expected parsing failure

Modified: trunk/LayoutTests/sputnik/Conformance/07_Lexical_Conventions/7.2_White_Space/S7.2_A5_T3-expected.txt (90534 => 90535)


--- trunk/LayoutTests/sputnik/Conformance/07_Lexical_Conventions/7.2_White_Space/S7.2_A5_T3-expected.txt	2011-07-07 04:11:33 UTC (rev 90534)
+++ trunk/LayoutTests/sputnik/Conformance/07_Lexical_Conventions/7.2_White_Space/S7.2_A5_T3-expected.txt	2011-07-07 04:20:06 UTC (rev 90535)
@@ -1,4 +1,4 @@
-CONSOLE MESSAGE: line 76: SyntaxError: Expected an identifier but found '\u000C' instead
+CONSOLE MESSAGE: line 76: SyntaxError: Unrecognized token '\u000C'
 S7.2_A5_T3
 
 PASS Expected parsing failure

Modified: trunk/LayoutTests/sputnik/Conformance/07_Lexical_Conventions/7.2_White_Space/S7.2_A5_T4-expected.txt (90534 => 90535)


--- trunk/LayoutTests/sputnik/Conformance/07_Lexical_Conventions/7.2_White_Space/S7.2_A5_T4-expected.txt	2011-07-07 04:11:33 UTC (rev 90534)
+++ trunk/LayoutTests/sputnik/Conformance/07_Lexical_Conventions/7.2_White_Space/S7.2_A5_T4-expected.txt	2011-07-07 04:20:06 UTC (rev 90535)
@@ -1,4 +1,4 @@
-CONSOLE MESSAGE: line 76: SyntaxError: Expected an identifier but found '\u0020' instead
+CONSOLE MESSAGE: line 76: SyntaxError: Unrecognized token '\u0020'
 S7.2_A5_T4
 
 PASS Expected parsing failure

Modified: trunk/LayoutTests/sputnik/Conformance/07_Lexical_Conventions/7.2_White_Space/S7.2_A5_T5-expected.txt (90534 => 90535)


--- trunk/LayoutTests/sputnik/Conformance/07_Lexical_Conventions/7.2_White_Space/S7.2_A5_T5-expected.txt	2011-07-07 04:11:33 UTC (rev 90534)
+++ trunk/LayoutTests/sputnik/Conformance/07_Lexical_Conventions/7.2_White_Space/S7.2_A5_T5-expected.txt	2011-07-07 04:20:06 UTC (rev 90535)
@@ -1,4 +1,4 @@
-CONSOLE MESSAGE: line 76: SyntaxError: Expected an identifier but found '\u00A0' instead
+CONSOLE MESSAGE: line 76: SyntaxError: Unrecognized token '\u00A0'
 S7.2_A5_T5
 
 PASS Expected parsing failure

Modified: trunk/LayoutTests/sputnik/Conformance/07_Lexical_Conventions/7.3_Line_Terminators/S7.3_A6_T1-expected.txt (90534 => 90535)


--- trunk/LayoutTests/sputnik/Conformance/07_Lexical_Conventions/7.3_Line_Terminators/S7.3_A6_T1-expected.txt	2011-07-07 04:11:33 UTC (rev 90534)
+++ trunk/LayoutTests/sputnik/Conformance/07_Lexical_Conventions/7.3_Line_Terminators/S7.3_A6_T1-expected.txt	2011-07-07 04:20:06 UTC (rev 90535)
@@ -1,4 +1,4 @@
-CONSOLE MESSAGE: line 76: SyntaxError: Expected an identifier but found '\u000A' instead
+CONSOLE MESSAGE: line 76: SyntaxError: Unrecognized token '\u000A'
 S7.3_A6_T1
 
 PASS Expected parsing failure

Modified: trunk/LayoutTests/sputnik/Conformance/07_Lexical_Conventions/7.3_Line_Terminators/S7.3_A6_T2-expected.txt (90534 => 90535)


--- trunk/LayoutTests/sputnik/Conformance/07_Lexical_Conventions/7.3_Line_Terminators/S7.3_A6_T2-expected.txt	2011-07-07 04:11:33 UTC (rev 90534)
+++ trunk/LayoutTests/sputnik/Conformance/07_Lexical_Conventions/7.3_Line_Terminators/S7.3_A6_T2-expected.txt	2011-07-07 04:20:06 UTC (rev 90535)
@@ -1,4 +1,4 @@
-CONSOLE MESSAGE: line 76: SyntaxError: Expected an identifier but found '\u000D' instead
+CONSOLE MESSAGE: line 76: SyntaxError: Unrecognized token '\u000D'
 S7.3_A6_T2
 
 PASS Expected parsing failure

Modified: trunk/LayoutTests/sputnik/Conformance/07_Lexical_Conventions/7.3_Line_Terminators/S7.3_A6_T3-expected.txt (90534 => 90535)


--- trunk/LayoutTests/sputnik/Conformance/07_Lexical_Conventions/7.3_Line_Terminators/S7.3_A6_T3-expected.txt	2011-07-07 04:11:33 UTC (rev 90534)
+++ trunk/LayoutTests/sputnik/Conformance/07_Lexical_Conventions/7.3_Line_Terminators/S7.3_A6_T3-expected.txt	2011-07-07 04:20:06 UTC (rev 90535)
@@ -1,4 +1,4 @@
-CONSOLE MESSAGE: line 76: SyntaxError: Expected an identifier but found '\u2028' instead
+CONSOLE MESSAGE: line 76: SyntaxError: Unrecognized token '\u2028'
 S7.3_A6_T3
 
 PASS Expected parsing failure

Modified: trunk/LayoutTests/sputnik/Conformance/07_Lexical_Conventions/7.3_Line_Terminators/S7.3_A6_T4-expected.txt (90534 => 90535)


--- trunk/LayoutTests/sputnik/Conformance/07_Lexical_Conventions/7.3_Line_Terminators/S7.3_A6_T4-expected.txt	2011-07-07 04:11:33 UTC (rev 90534)
+++ trunk/LayoutTests/sputnik/Conformance/07_Lexical_Conventions/7.3_Line_Terminators/S7.3_A6_T4-expected.txt	2011-07-07 04:20:06 UTC (rev 90535)
@@ -1,4 +1,4 @@
-CONSOLE MESSAGE: line 76: SyntaxError: Expected an identifier but found '\u2029' instead
+CONSOLE MESSAGE: line 76: SyntaxError: Unrecognized token '\u2029'
 S7.3_A6_T4
 
 PASS Expected parsing failure

Modified: trunk/LayoutTests/sputnik/Conformance/12_Statement/12.14_The_try_Statement/S12.14_A16_T13-expected.txt (90534 => 90535)


--- trunk/LayoutTests/sputnik/Conformance/12_Statement/12.14_The_try_Statement/S12.14_A16_T13-expected.txt	2011-07-07 04:11:33 UTC (rev 90534)
+++ trunk/LayoutTests/sputnik/Conformance/12_Statement/12.14_The_try_Statement/S12.14_A16_T13-expected.txt	2011-07-07 04:20:06 UTC (rev 90535)
@@ -1,4 +1,4 @@
-CONSOLE MESSAGE: line 80: SyntaxError: Expected an identifier but found '"22"' instead
+CONSOLE MESSAGE: line 80: SyntaxError: Unexpected string "22"
 S12.14_A16_T13
 
 PASS Expected parsing failure

Modified: trunk/Source/_javascript_Core/ChangeLog (90534 => 90535)


--- trunk/Source/_javascript_Core/ChangeLog	2011-07-07 04:11:33 UTC (rev 90534)
+++ trunk/Source/_javascript_Core/ChangeLog	2011-07-07 04:20:06 UTC (rev 90535)
@@ -1,3 +1,18 @@
+2011-07-06  Juan C. Montemayor  <[email protected]>
+
+        ASSERT_NOT_REACHED running test 262
+        https://bugs.webkit.org/show_bug.cgi?id=63951
+        
+        Added a case to the switch statement where the code was failing. Fixed
+        some logic as well that gave faulty error messages.
+
+        Reviewed by Gavin Barraclough.
+
+        * parser/JSParser.cpp:
+        (JSC::JSParser::getTokenName):
+        (JSC::JSParser::updateErrorMessageSpecialCase):
+        (JSC::JSParser::updateErrorMessage):
+
 2011-07-06  Filip Pizlo  <[email protected]>
 
         DFG JIT implementation of op_call results in regressions on sunspider

Modified: trunk/Source/_javascript_Core/parser/JSParser.cpp (90534 => 90535)


--- trunk/Source/_javascript_Core/parser/JSParser.cpp	2011-07-07 04:11:33 UTC (rev 90534)
+++ trunk/Source/_javascript_Core/parser/JSParser.cpp	2011-07-07 04:20:06 UTC (rev 90535)
@@ -191,8 +191,6 @@
             return "continue";
         case FUNCTION: 
             return "function";
-        case RETURN: 
-            return 0;
         case IF: 
             return "if";
         case THISTOKEN: 
@@ -205,9 +203,6 @@
             return "switch";
         case WITH: 
             return "with";
-        case RESERVED_IF_STRICT:
-        case RESERVED: 
-            return 0;
         case THROW: 
             return "throw";
         case TRY: 
@@ -236,22 +231,12 @@
             return ",";
         case QUESTION: 
             return "?";
-        case NUMBER: 
-            return 0;
-        case IDENT: 
-            return 0;
-        case STRING: 
-            return 0;
         case SEMICOLON: 
             return ";";
         case COLON: 
             return ":";
         case DOT: 
             return ".";
-        case ERRORTOK: 
-            return 0;
-        case EOFTOK: 
-            return 0;
         case EQUAL: 
             return "=";
         case PLUSEQUAL: 
@@ -338,6 +323,15 @@
             return "/";
         case MOD: 
             return "%";
+        case RETURN: 
+        case RESERVED_IF_STRICT:
+        case RESERVED: 
+        case NUMBER:
+        case IDENT: 
+        case STRING: 
+        case ERRORTOK:
+        case EOFTOK: 
+            return 0;
         case LastUntaggedToken: 
             break;
         }
@@ -349,6 +343,12 @@
     {
         String errorMessage;
         switch (expectedToken) {
+        case RESERVED_IF_STRICT:
+            errorMessage = "Use of reserved word '";
+            errorMessage += getToken().impl();
+            errorMessage += "' in strict mode";
+            m_errorMessage = errorMessage.impl();
+            return;
         case RESERVED:
             errorMessage = "Use of reserved word '";
             errorMessage += getToken().impl();
@@ -405,10 +405,14 @@
     {
         m_error = true;
         const char* name = getTokenName(expectedToken);
-        if (!name) 
-            updateErrorMessageSpecialCase(expectedToken);
-        else
+        if (name)
             m_errorMessage = UString(String::format("Expected token '%s'", name).impl());
+        else {
+            if (!getTokenName(m_token.m_type))
+                updateErrorMessageSpecialCase(m_token.m_type);
+            else
+                updateErrorMessageSpecialCase(expectedToken);
+        } 
     }
     
     NEVER_INLINE void updateErrorWithNameAndMessage(const char* beforeMsg, UString name, const char* afterMsg) 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to