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

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

Issue 7053035: Fix a number of tests that incorrectly used assertUnreachable. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address comments. Created 9 years, 6 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 | « test/mjsunit/regress/regress-244.js ('k') | test/mjsunit/strict-mode-eval.js » ('j') | 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 824 matching lines...) Expand 10 before | Expand all | Expand 10 after
835 var name = "prop" + "erty"; // to avoid symbol path. 835 var name = "prop" + "erty"; // to avoid symbol path.
836 var o = {}; 836 var o = {};
837 Object.defineProperty(o, "property", { value: 7 }); 837 Object.defineProperty(o, "property", { value: 7 });
838 838
839 function strict(o, name) { 839 function strict(o, name) {
840 "use strict"; 840 "use strict";
841 o[name] = "new value"; 841 o[name] = "new value";
842 } 842 }
843 843
844 for (var i = 0; i < 10; i ++) { 844 for (var i = 0; i < 10; i ++) {
845 var exception = false;
845 try { 846 try {
846 strict(o, name); 847 strict(o, name);
847 assertUnreachable();
848 } catch(e) { 848 } catch(e) {
849 exception = true;
849 assertInstanceof(e, TypeError); 850 assertInstanceof(e, TypeError);
850 } 851 }
852 assertTrue(exception);
851 } 853 }
852 })(); 854 })();
853 855
854 856
855 // Specialized KeyedStoreIC experiencing miss. 857 // Specialized KeyedStoreIC experiencing miss.
856 (function testKeyedStoreICStrict() { 858 (function testKeyedStoreICStrict() {
857 var o = [9,8,7,6,5,4,3,2,1]; 859 var o = [9,8,7,6,5,4,3,2,1];
858 860
859 function test(o, i, v) { 861 function test(o, i, v) {
860 "use strict"; 862 "use strict";
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after
1179 assertEquals(test(i), true); 1181 assertEquals(test(i), true);
1180 } 1182 }
1181 })(); 1183 })();
1182 1184
1183 1185
1184 (function TestStrictModeEval() { 1186 (function TestStrictModeEval() {
1185 "use strict"; 1187 "use strict";
1186 eval("var eval_local = 10;"); 1188 eval("var eval_local = 10;");
1187 assertThrows(function() { return eval_local; }, ReferenceError); 1189 assertThrows(function() { return eval_local; }, ReferenceError);
1188 })(); 1190 })();
OLDNEW
« no previous file with comments | « test/mjsunit/regress/regress-244.js ('k') | test/mjsunit/strict-mode-eval.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698