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

Unified Diff: test/mjsunit/harmony/rest-params.js

Issue 1281163002: [parser] partially revert "use-strict directives in function body affect init block" Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/mjsunit/harmony/destructuring.js ('k') | test/mjsunit/harmony/spread-call-super-property.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/harmony/rest-params.js
diff --git a/test/mjsunit/harmony/rest-params.js b/test/mjsunit/harmony/rest-params.js
index fe7ee2adb81186076d1a32bee92642d1a2cdc430..0b05d33824252ee2e5aa8eb3a123096badcf0bbd 100644
--- a/test/mjsunit/harmony/rest-params.js
+++ b/test/mjsunit/harmony/rest-params.js
@@ -16,18 +16,20 @@
return args.length; })(1,2,3,4,5));
})();
-function strictTest(a, b, ...c) {
+var strictTest = (function() {
"use strict";
- assertEquals(Array, c.constructor);
- assertTrue(Array.isArray(c));
+ return function strictTest(a, b, ...c) {
+ assertEquals(Array, c.constructor);
+ assertTrue(Array.isArray(c));
- var expectedLength = arguments.length >= 3 ? arguments.length - 2 : 0;
- assertEquals(expectedLength, c.length);
+ var expectedLength = arguments.length >= 3 ? arguments.length - 2 : 0;
+ assertEquals(expectedLength, c.length);
- for (var i = 2, j = 0; i < arguments.length; ++i) {
- assertEquals(c[j++], arguments[i]);
- }
-}
+ for (var i = 2, j = 0; i < arguments.length; ++i) {
+ assertEquals(c[j++], arguments[i]);
+ }
+ };
+})();
function sloppyTest(a, b, ...c) {
assertEquals(Array, c.constructor);
@@ -144,8 +146,8 @@ var O = {
(function testNoAliasArgumentsStrict() {
+ "use strict";
function strictF(a, ...rest) {
- "use strict";
arguments[0] = 1;
assertEquals(3, a);
arguments[1] = 2;
« no previous file with comments | « test/mjsunit/harmony/destructuring.js ('k') | test/mjsunit/harmony/spread-call-super-property.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698