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

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

Issue 8404030: Version 3.7.1 (Closed) Base URL: http://v8.googlecode.com/svn/trunk/
Patch Set: Created 9 years, 1 month 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/stack-traces-2.js ('k') | test/mjsunit/to_number_order.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 1033 matching lines...) Expand 10 before | Expand all | Expand 10 after
1044 assertFalse(descriptor.configurable); 1044 assertFalse(descriptor.configurable);
1045 } 1045 }
1046 1046
1047 1047
1048 (function TestStrictFunctionPills() { 1048 (function TestStrictFunctionPills() {
1049 function strict() { 1049 function strict() {
1050 "use strict"; 1050 "use strict";
1051 } 1051 }
1052 assertThrows(function() { strict.caller; }, TypeError); 1052 assertThrows(function() { strict.caller; }, TypeError);
1053 assertThrows(function() { strict.arguments; }, TypeError); 1053 assertThrows(function() { strict.arguments; }, TypeError);
1054 assertThrows(function() { strict.caller = 42; }, TypeError);
1055 assertThrows(function() { strict.arguments = 42; }, TypeError);
1054 1056
1055 var another = new Function("'use strict'"); 1057 var another = new Function("'use strict'");
1056 assertThrows(function() { another.caller; }, TypeError); 1058 assertThrows(function() { another.caller; }, TypeError);
1057 assertThrows(function() { another.arguments; }, TypeError); 1059 assertThrows(function() { another.arguments; }, TypeError);
1060 assertThrows(function() { another.caller = 42; }, TypeError);
1061 assertThrows(function() { another.arguments = 42; }, TypeError);
1058 1062
1059 var third = (function() { "use strict"; return function() {}; })(); 1063 var third = (function() { "use strict"; return function() {}; })();
1060 assertThrows(function() { third.caller; }, TypeError); 1064 assertThrows(function() { third.caller; }, TypeError);
1061 assertThrows(function() { third.arguments; }, TypeError); 1065 assertThrows(function() { third.arguments; }, TypeError);
1066 assertThrows(function() { third.caller = 42; }, TypeError);
1067 assertThrows(function() { third.arguments = 42; }, TypeError);
1062 1068
1063 CheckPillDescriptor(strict, "caller"); 1069 CheckPillDescriptor(strict, "caller");
1064 CheckPillDescriptor(strict, "arguments"); 1070 CheckPillDescriptor(strict, "arguments");
1065 CheckPillDescriptor(another, "caller"); 1071 CheckPillDescriptor(another, "caller");
1066 CheckPillDescriptor(another, "arguments"); 1072 CheckPillDescriptor(another, "arguments");
1067 CheckPillDescriptor(third, "caller"); 1073 CheckPillDescriptor(third, "caller");
1068 CheckPillDescriptor(third, "arguments"); 1074 CheckPillDescriptor(third, "arguments");
1069 })(); 1075 })();
1070 1076
1071 1077
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
1177 assertEquals(test(i), true); 1183 assertEquals(test(i), true);
1178 } 1184 }
1179 })(); 1185 })();
1180 1186
1181 1187
1182 (function TestStrictModeEval() { 1188 (function TestStrictModeEval() {
1183 "use strict"; 1189 "use strict";
1184 eval("var eval_local = 10;"); 1190 eval("var eval_local = 10;");
1185 assertThrows(function() { return eval_local; }, ReferenceError); 1191 assertThrows(function() { return eval_local; }, ReferenceError);
1186 })(); 1192 })();
OLDNEW
« no previous file with comments | « test/mjsunit/stack-traces-2.js ('k') | test/mjsunit/to_number_order.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698