Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(51)

Side by Side Diff: test/mjsunit/strict-mode.js

Issue 6592031: Disable const in strict mode. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/parser.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 CheckStrictMode("function strict() { var x = ++arguments; }", SyntaxError); 273 CheckStrictMode("function strict() { var x = ++arguments; }", SyntaxError);
274 274
275 // Prefix decrement with eval or arguments 275 // Prefix decrement with eval or arguments
276 CheckStrictMode("function strict() { --eval; }", SyntaxError); 276 CheckStrictMode("function strict() { --eval; }", SyntaxError);
277 CheckStrictMode("function strict() { --arguments; }", SyntaxError); 277 CheckStrictMode("function strict() { --arguments; }", SyntaxError);
278 CheckStrictMode("function strict() { print(--eval); }", SyntaxError); 278 CheckStrictMode("function strict() { print(--eval); }", SyntaxError);
279 CheckStrictMode("function strict() { print(--arguments); }", SyntaxError); 279 CheckStrictMode("function strict() { print(--arguments); }", SyntaxError);
280 CheckStrictMode("function strict() { var x = --eval; }", SyntaxError); 280 CheckStrictMode("function strict() { var x = --eval; }", SyntaxError);
281 CheckStrictMode("function strict() { var x = --arguments; }", SyntaxError); 281 CheckStrictMode("function strict() { var x = --arguments; }", SyntaxError);
282 282
283 // Use of const in strict mode is disallowed in anticipation of ES Harmony.
284 CheckStrictMode("const x = 0;", SyntaxError);
285 CheckStrictMode("for (const x = 0; false;) {}", SyntaxError);
286 CheckStrictMode("function strict() { const x = 0; }", SyntaxError);
287
283 // Delete of an unqualified identifier 288 // Delete of an unqualified identifier
284 CheckStrictMode("delete unqualified;", SyntaxError); 289 CheckStrictMode("delete unqualified;", SyntaxError);
285 CheckStrictMode("function strict() { delete unqualified; }", SyntaxError); 290 CheckStrictMode("function strict() { delete unqualified; }", SyntaxError);
286 CheckStrictMode("function function_name() { delete function_name; }", 291 CheckStrictMode("function function_name() { delete function_name; }",
287 SyntaxError); 292 SyntaxError);
288 CheckStrictMode("function strict(parameter) { delete parameter; }", 293 CheckStrictMode("function strict(parameter) { delete parameter; }",
289 SyntaxError); 294 SyntaxError);
290 CheckStrictMode("function strict() { var variable; delete variable; }", 295 CheckStrictMode("function strict() { var variable; delete variable; }",
291 SyntaxError); 296 SyntaxError);
292 CheckStrictMode("var variable; delete variable;", SyntaxError); 297 CheckStrictMode("var variable; delete variable;", SyntaxError);
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after
693 assertEquals(callIndexedNonStrictGet(false), "object"); 698 assertEquals(callIndexedNonStrictGet(false), "object");
694 699
695 } 700 }
696 } finally { 701 } finally {
697 // Cleanup 702 // Cleanup
698 cleanup(String); 703 cleanup(String);
699 cleanup(Number); 704 cleanup(Number);
700 cleanup(Boolean); 705 cleanup(Boolean);
701 } 706 }
702 })(); 707 })();
OLDNEW
« no previous file with comments | « src/parser.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698