Changeset 90535 in webkit
- Timestamp:
- Jul 6, 2011 9:20:06 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r90518 r90535 1 2011-07-06 Juan C. Montemayor <jmont@apple.com> 2 3 ASSERT_NOT_REACHED running test 262 4 https://bugs.webkit.org/show_bug.cgi?id=63951 5 6 Added a test to check compliance with reserved words in strict mode. 7 Updated test results. 8 9 Reviewed by Gavin Barraclough. 10 11 * fast/js/kde/parse-expected.txt: 12 * fast/js/reserved-words-as-property-expected.txt: 13 * fast/js/reserved-words-strict-expected.txt: Added. 14 * fast/js/reserved-words-strict.html: Added. 15 * fast/js/script-tests/reserved-words-strict.js: Added. 16 (isReserved): 17 * platform/chromium/fast/js/reserved-words-strict-expected.txt: Added. 18 * sputnik/Conformance/07_Lexical_Conventions/7.2_White_Space/S7.2_A5_T1-expected.txt: 19 * sputnik/Conformance/07_Lexical_Conventions/7.2_White_Space/S7.2_A5_T2-expected.txt: 20 * sputnik/Conformance/07_Lexical_Conventions/7.2_White_Space/S7.2_A5_T3-expected.txt: 21 * sputnik/Conformance/07_Lexical_Conventions/7.2_White_Space/S7.2_A5_T4-expected.txt: 22 * sputnik/Conformance/07_Lexical_Conventions/7.2_White_Space/S7.2_A5_T5-expected.txt: 23 * sputnik/Conformance/07_Lexical_Conventions/7.3_Line_Terminators/S7.3_A6_T1-expected.txt: 24 * sputnik/Conformance/07_Lexical_Conventions/7.3_Line_Terminators/S7.3_A6_T2-expected.txt: 25 * sputnik/Conformance/07_Lexical_Conventions/7.3_Line_Terminators/S7.3_A6_T3-expected.txt: 26 * sputnik/Conformance/07_Lexical_Conventions/7.3_Line_Terminators/S7.3_A6_T4-expected.txt: 27 * sputnik/Conformance/12_Statement/12.14_The_try_Statement/S12.14_A16_T13-expected.txt: 28 1 29 2011-07-06 Johnny Ding <jnd@chromium.org> 2 30 -
trunk/LayoutTests/fast/js/kde/parse-expected.txt
r90265 r90535 21 21 PASS var f\u0030 = 103; f0 is 103 22 22 PASS var \u00E9\u0100\u02AF\u0388\u18A8 = 104; \u00E9\u0100\u02AF\u0388\u18A8; is 104 23 PASS var f\u00F7; threw exception SyntaxError: Expected an identifier but found 'f\u00F7' instead.24 PASS var \u0030; threw exception SyntaxError: Expected an identifier but found '\u0030' instead.25 PASS var test = { }; test.i= 0; test.i\u002b= 1; test.i; threw exception SyntaxError: Expected an identifier but found 'i\u002b' instead.23 PASS var f\u00F7; threw exception SyntaxError: Unrecognized token 'f\u00F7'. 24 PASS var \u0030; threw exception SyntaxError: Unrecognized token '\u0030'. 25 PASS var test = { }; test.i= 0; test.i\u002b= 1; test.i; threw exception SyntaxError: Unrecognized token 'i\u002b'. 26 26 PASS var test = { }; test.i= 0; test.i+= 1; test.i; is 1 27 27 PASS successfullyParsed is true -
trunk/LayoutTests/fast/js/reserved-words-as-property-expected.txt
r89257 r90535 156 156 PASS function new(){} threw exception SyntaxError: Unexpected token 'new'. 157 157 PASS (function(){function new(){}}) threw exception SyntaxError: Unexpected token 'new'. 158 PASS var return threw exception SyntaxError: Expected an identifier but found 'return' instead.159 PASS (function(){var return}) threw exception SyntaxError: Expected an identifier but found 'return' instead.160 PASS function g(return){} threw exception SyntaxError: Expected an identifier but found 'return' instead.161 PASS (function(){function g(return){}}) threw exception SyntaxError: Expected an identifier but found 'return' instead.162 PASS try{}catch(return){} threw exception SyntaxError: Expected an identifier but found 'return' instead.163 PASS (function(){try{}catch(return){}}) threw exception SyntaxError: Expected an identifier but found 'return' instead.158 PASS var return threw exception SyntaxError: Return statements are only valid inside functions. 159 PASS (function(){var return}) threw exception SyntaxError: Return statements are only valid inside functions. 160 PASS function g(return){} threw exception SyntaxError: Return statements are only valid inside functions. 161 PASS (function(){function g(return){}}) threw exception SyntaxError: Return statements are only valid inside functions. 162 PASS try{}catch(return){} threw exception SyntaxError: Return statements are only valid inside functions. 163 PASS (function(){try{}catch(return){}}) threw exception SyntaxError: Return statements are only valid inside functions. 164 164 PASS function return(){} threw exception SyntaxError: Return statements are only valid inside functions. 165 165 PASS (function(){function return(){}}) threw exception SyntaxError: Return statements are only valid inside functions. … … 236 236 PASS function with(){} threw exception SyntaxError: Unexpected token 'with'. 237 237 PASS (function(){function with(){}}) threw exception SyntaxError: Unexpected token 'with'. 238 PASS var class threw exception SyntaxError: Expected an identifier but found 'class' instead.239 PASS (function(){var class}) threw exception SyntaxError: Expected an identifier but found 'class' instead.240 PASS function g(class){} threw exception SyntaxError: Expected an identifier but found 'class' instead.241 PASS (function(){function g(class){}}) threw exception SyntaxError: Expected an identifier but found 'class' instead.242 PASS try{}catch(class){} threw exception SyntaxError: Expected an identifier but found 'class' instead.243 PASS (function(){try{}catch(class){}}) threw exception SyntaxError: Expected an identifier but found 'class' instead.238 PASS var class threw exception SyntaxError: Use of reserved word 'class'. 239 PASS (function(){var class}) threw exception SyntaxError: Use of reserved word 'class'. 240 PASS function g(class){} threw exception SyntaxError: Use of reserved word 'class'. 241 PASS (function(){function g(class){}}) threw exception SyntaxError: Use of reserved word 'class'. 242 PASS try{}catch(class){} threw exception SyntaxError: Use of reserved word 'class'. 243 PASS (function(){try{}catch(class){}}) threw exception SyntaxError: Use of reserved word 'class'. 244 244 PASS function class(){} threw exception SyntaxError: Use of reserved word 'class'. 245 245 PASS (function(){function class(){}}) threw exception SyntaxError: Use of reserved word 'class'. … … 252 252 PASS function const(){} threw exception SyntaxError: Unexpected token 'const'. 253 253 PASS (function(){function const(){}}) threw exception SyntaxError: Unexpected token 'const'. 254 PASS var enum threw exception SyntaxError: Expected an identifier but found 'enum' instead.255 PASS (function(){var enum}) threw exception SyntaxError: Expected an identifier but found 'enum' instead.256 PASS function g(enum){} threw exception SyntaxError: Expected an identifier but found 'enum' instead.257 PASS (function(){function g(enum){}}) threw exception SyntaxError: Expected an identifier but found 'enum' instead.258 PASS try{}catch(enum){} threw exception SyntaxError: Expected an identifier but found 'enum' instead.259 PASS (function(){try{}catch(enum){}}) threw exception SyntaxError: Expected an identifier but found 'enum' instead.254 PASS var enum threw exception SyntaxError: Use of reserved word 'enum'. 255 PASS (function(){var enum}) threw exception SyntaxError: Use of reserved word 'enum'. 256 PASS function g(enum){} threw exception SyntaxError: Use of reserved word 'enum'. 257 PASS (function(){function g(enum){}}) threw exception SyntaxError: Use of reserved word 'enum'. 258 PASS try{}catch(enum){} threw exception SyntaxError: Use of reserved word 'enum'. 259 PASS (function(){try{}catch(enum){}}) threw exception SyntaxError: Use of reserved word 'enum'. 260 260 PASS function enum(){} threw exception SyntaxError: Use of reserved word 'enum'. 261 261 PASS (function(){function enum(){}}) threw exception SyntaxError: Use of reserved word 'enum'. 262 PASS var export threw exception SyntaxError: Expected an identifier but found 'export' instead.263 PASS (function(){var export}) threw exception SyntaxError: Expected an identifier but found 'export' instead.264 PASS function g(export){} threw exception SyntaxError: Expected an identifier but found 'export' instead.265 PASS (function(){function g(export){}}) threw exception SyntaxError: Expected an identifier but found 'export' instead.266 PASS try{}catch(export){} threw exception SyntaxError: Expected an identifier but found 'export' instead.267 PASS (function(){try{}catch(export){}}) threw exception SyntaxError: Expected an identifier but found 'export' instead.262 PASS var export threw exception SyntaxError: Use of reserved word 'export'. 263 PASS (function(){var export}) threw exception SyntaxError: Use of reserved word 'export'. 264 PASS function g(export){} threw exception SyntaxError: Use of reserved word 'export'. 265 PASS (function(){function g(export){}}) threw exception SyntaxError: Use of reserved word 'export'. 266 PASS try{}catch(export){} threw exception SyntaxError: Use of reserved word 'export'. 267 PASS (function(){try{}catch(export){}}) threw exception SyntaxError: Use of reserved word 'export'. 268 268 PASS function export(){} threw exception SyntaxError: Use of reserved word 'export'. 269 269 PASS (function(){function export(){}}) threw exception SyntaxError: Use of reserved word 'export'. 270 PASS var extends threw exception SyntaxError: Expected an identifier but found 'extends' instead.271 PASS (function(){var extends}) threw exception SyntaxError: Expected an identifier but found 'extends' instead.272 PASS function g(extends){} threw exception SyntaxError: Expected an identifier but found 'extends' instead.273 PASS (function(){function g(extends){}}) threw exception SyntaxError: Expected an identifier but found 'extends' instead.274 PASS try{}catch(extends){} threw exception SyntaxError: Expected an identifier but found 'extends' instead.275 PASS (function(){try{}catch(extends){}}) threw exception SyntaxError: Expected an identifier but found 'extends' instead.270 PASS var extends threw exception SyntaxError: Use of reserved word 'extends'. 271 PASS (function(){var extends}) threw exception SyntaxError: Use of reserved word 'extends'. 272 PASS function g(extends){} threw exception SyntaxError: Use of reserved word 'extends'. 273 PASS (function(){function g(extends){}}) threw exception SyntaxError: Use of reserved word 'extends'. 274 PASS try{}catch(extends){} threw exception SyntaxError: Use of reserved word 'extends'. 275 PASS (function(){try{}catch(extends){}}) threw exception SyntaxError: Use of reserved word 'extends'. 276 276 PASS function extends(){} threw exception SyntaxError: Use of reserved word 'extends'. 277 277 PASS (function(){function extends(){}}) threw exception SyntaxError: Use of reserved word 'extends'. 278 PASS var import threw exception SyntaxError: Expected an identifier but found 'import' instead.279 PASS (function(){var import}) threw exception SyntaxError: Expected an identifier but found 'import' instead.280 PASS function g(import){} threw exception SyntaxError: Expected an identifier but found 'import' instead.281 PASS (function(){function g(import){}}) threw exception SyntaxError: Expected an identifier but found 'import' instead.282 PASS try{}catch(import){} threw exception SyntaxError: Expected an identifier but found 'import' instead.283 PASS (function(){try{}catch(import){}}) threw exception SyntaxError: Expected an identifier but found 'import' instead.278 PASS var import threw exception SyntaxError: Use of reserved word 'import'. 279 PASS (function(){var import}) threw exception SyntaxError: Use of reserved word 'import'. 280 PASS function g(import){} threw exception SyntaxError: Use of reserved word 'import'. 281 PASS (function(){function g(import){}}) threw exception SyntaxError: Use of reserved word 'import'. 282 PASS try{}catch(import){} threw exception SyntaxError: Use of reserved word 'import'. 283 PASS (function(){try{}catch(import){}}) threw exception SyntaxError: Use of reserved word 'import'. 284 284 PASS function import(){} threw exception SyntaxError: Use of reserved word 'import'. 285 285 PASS (function(){function import(){}}) threw exception SyntaxError: Use of reserved word 'import'. 286 PASS var super threw exception SyntaxError: Expected an identifier but found 'super' instead.287 PASS (function(){var super}) threw exception SyntaxError: Expected an identifier but found 'super' instead.288 PASS function g(super){} threw exception SyntaxError: Expected an identifier but found 'super' instead.289 PASS (function(){function g(super){}}) threw exception SyntaxError: Expected an identifier but found 'super' instead.290 PASS try{}catch(super){} threw exception SyntaxError: Expected an identifier but found 'super' instead.291 PASS (function(){try{}catch(super){}}) threw exception SyntaxError: Expected an identifier but found 'super' instead.286 PASS var super threw exception SyntaxError: Use of reserved word 'super'. 287 PASS (function(){var super}) threw exception SyntaxError: Use of reserved word 'super'. 288 PASS function g(super){} threw exception SyntaxError: Use of reserved word 'super'. 289 PASS (function(){function g(super){}}) threw exception SyntaxError: Use of reserved word 'super'. 290 PASS try{}catch(super){} threw exception SyntaxError: Use of reserved word 'super'. 291 PASS (function(){try{}catch(super){}}) threw exception SyntaxError: Use of reserved word 'super'. 292 292 PASS function super(){} threw exception SyntaxError: Use of reserved word 'super'. 293 293 PASS (function(){function super(){}}) threw exception SyntaxError: Use of reserved word 'super'. -
trunk/LayoutTests/sputnik/Conformance/07_Lexical_Conventions/7.2_White_Space/S7.2_A5_T1-expected.txt
r89257 r90535 1 CONSOLE MESSAGE: line 76: SyntaxError: Expected an identifier but found '\u0009' instead1 CONSOLE MESSAGE: line 76: SyntaxError: Unrecognized token '\u0009' 2 2 S7.2_A5_T1 3 3 -
trunk/LayoutTests/sputnik/Conformance/07_Lexical_Conventions/7.2_White_Space/S7.2_A5_T2-expected.txt
r89257 r90535 1 CONSOLE MESSAGE: line 76: SyntaxError: Expected an identifier but found '\u000B' instead1 CONSOLE MESSAGE: line 76: SyntaxError: Unrecognized token '\u000B' 2 2 S7.2_A5_T2 3 3 -
trunk/LayoutTests/sputnik/Conformance/07_Lexical_Conventions/7.2_White_Space/S7.2_A5_T3-expected.txt
r89257 r90535 1 CONSOLE MESSAGE: line 76: SyntaxError: Expected an identifier but found '\u000C' instead1 CONSOLE MESSAGE: line 76: SyntaxError: Unrecognized token '\u000C' 2 2 S7.2_A5_T3 3 3 -
trunk/LayoutTests/sputnik/Conformance/07_Lexical_Conventions/7.2_White_Space/S7.2_A5_T4-expected.txt
r89257 r90535 1 CONSOLE MESSAGE: line 76: SyntaxError: Expected an identifier but found '\u0020' instead1 CONSOLE MESSAGE: line 76: SyntaxError: Unrecognized token '\u0020' 2 2 S7.2_A5_T4 3 3 -
trunk/LayoutTests/sputnik/Conformance/07_Lexical_Conventions/7.2_White_Space/S7.2_A5_T5-expected.txt
r89257 r90535 1 CONSOLE MESSAGE: line 76: SyntaxError: Expected an identifier but found '\u00A0' instead1 CONSOLE MESSAGE: line 76: SyntaxError: Unrecognized token '\u00A0' 2 2 S7.2_A5_T5 3 3 -
trunk/LayoutTests/sputnik/Conformance/07_Lexical_Conventions/7.3_Line_Terminators/S7.3_A6_T1-expected.txt
r89257 r90535 1 CONSOLE MESSAGE: line 76: SyntaxError: Expected an identifier but found '\u000A' instead1 CONSOLE MESSAGE: line 76: SyntaxError: Unrecognized token '\u000A' 2 2 S7.3_A6_T1 3 3 -
trunk/LayoutTests/sputnik/Conformance/07_Lexical_Conventions/7.3_Line_Terminators/S7.3_A6_T2-expected.txt
r89257 r90535 1 CONSOLE MESSAGE: line 76: SyntaxError: Expected an identifier but found '\u000D' instead1 CONSOLE MESSAGE: line 76: SyntaxError: Unrecognized token '\u000D' 2 2 S7.3_A6_T2 3 3 -
trunk/LayoutTests/sputnik/Conformance/07_Lexical_Conventions/7.3_Line_Terminators/S7.3_A6_T3-expected.txt
r89257 r90535 1 CONSOLE MESSAGE: line 76: SyntaxError: Expected an identifier but found '\u2028' instead1 CONSOLE MESSAGE: line 76: SyntaxError: Unrecognized token '\u2028' 2 2 S7.3_A6_T3 3 3 -
trunk/LayoutTests/sputnik/Conformance/07_Lexical_Conventions/7.3_Line_Terminators/S7.3_A6_T4-expected.txt
r89257 r90535 1 CONSOLE MESSAGE: line 76: SyntaxError: Expected an identifier but found '\u2029' instead1 CONSOLE MESSAGE: line 76: SyntaxError: Unrecognized token '\u2029' 2 2 S7.3_A6_T4 3 3 -
trunk/LayoutTests/sputnik/Conformance/12_Statement/12.14_The_try_Statement/S12.14_A16_T13-expected.txt
r89257 r90535 1 CONSOLE MESSAGE: line 80: SyntaxError: Expected an identifier but found '"22"' instead1 CONSOLE MESSAGE: line 80: SyntaxError: Unexpected string "22" 2 2 S12.14_A16_T13 3 3 -
trunk/Source/JavaScriptCore/ChangeLog
r90533 r90535 1 2011-07-06 Juan C. Montemayor <jmont@apple.com> 2 3 ASSERT_NOT_REACHED running test 262 4 https://bugs.webkit.org/show_bug.cgi?id=63951 5 6 Added a case to the switch statement where the code was failing. Fixed 7 some logic as well that gave faulty error messages. 8 9 Reviewed by Gavin Barraclough. 10 11 * parser/JSParser.cpp: 12 (JSC::JSParser::getTokenName): 13 (JSC::JSParser::updateErrorMessageSpecialCase): 14 (JSC::JSParser::updateErrorMessage): 15 1 16 2011-07-06 Filip Pizlo <fpizlo@apple.com> 2 17 -
trunk/Source/JavaScriptCore/parser/JSParser.cpp
r89371 r90535 192 192 case FUNCTION: 193 193 return "function"; 194 case RETURN:195 return 0;196 194 case IF: 197 195 return "if"; … … 206 204 case WITH: 207 205 return "with"; 208 case RESERVED_IF_STRICT:209 case RESERVED:210 return 0;211 206 case THROW: 212 207 return "throw"; … … 237 232 case QUESTION: 238 233 return "?"; 239 case NUMBER:240 return 0;241 case IDENT:242 return 0;243 case STRING:244 return 0;245 234 case SEMICOLON: 246 235 return ";"; … … 249 238 case DOT: 250 239 return "."; 251 case ERRORTOK:252 return 0;253 case EOFTOK:254 return 0;255 240 case EQUAL: 256 241 return "="; … … 339 324 case MOD: 340 325 return "%"; 326 case RETURN: 327 case RESERVED_IF_STRICT: 328 case RESERVED: 329 case NUMBER: 330 case IDENT: 331 case STRING: 332 case ERRORTOK: 333 case EOFTOK: 334 return 0; 341 335 case LastUntaggedToken: 342 336 break; … … 350 344 String errorMessage; 351 345 switch (expectedToken) { 346 case RESERVED_IF_STRICT: 347 errorMessage = "Use of reserved word '"; 348 errorMessage += getToken().impl(); 349 errorMessage += "' in strict mode"; 350 m_errorMessage = errorMessage.impl(); 351 return; 352 352 case RESERVED: 353 353 errorMessage = "Use of reserved word '"; … … 406 406 m_error = true; 407 407 const char* name = getTokenName(expectedToken); 408 if (!name) 409 updateErrorMessageSpecialCase(expectedToken); 410 else 408 if (name) 411 409 m_errorMessage = UString(String::format("Expected token '%s'", name).impl()); 410 else { 411 if (!getTokenName(m_token.m_type)) 412 updateErrorMessageSpecialCase(m_token.m_type); 413 else 414 updateErrorMessageSpecialCase(expectedToken); 415 } 412 416 } 413 417
Note: See TracChangeset
for help on using the changeset viewer.