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

Unified Diff: test/mjsunit/harmony/block-const-assign.js

Issue 977543002: [es6] Fix for-const loops (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 10 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
Index: test/mjsunit/harmony/block-const-assign.js
diff --git a/test/mjsunit/harmony/block-const-assign.js b/test/mjsunit/harmony/block-const-assign.js
index c21a0a34803a686e677a5ce6a8b10cdeecf1d8ac..397695f86aecd1e2a5b8637e6c74147269e10d89 100644
--- a/test/mjsunit/harmony/block-const-assign.js
+++ b/test/mjsunit/harmony/block-const-assign.js
@@ -93,6 +93,22 @@ function constDecl9(use) {
return "(function constvar() { " + use + "; })();";
}
+// For loop variable.
+function constDecl10(use) {
+ return "(function() { for (const constvar = 0; ;) { " + use + "; } })();";
+}
+
+// For-in loop variable.
+function constDecl11(use) {
+ return "(function() { for (const constvar in {a: 1}) { " + use + "; } })();";
+}
+
+// For-of loop variable.
+function constDecl12(use) {
+ return "(function() { for (const constvar of [1]) { " + use + "; } })();";
+}
+
+
let decls = [ constDecl0,
constDecl1,
constDecl2,
@@ -102,7 +118,10 @@ let decls = [ constDecl0,
constDecl6,
constDecl7,
constDecl8,
- constDecl9
+ constDecl9,
+ constDecl10,
+ constDecl11,
+ constDecl12
];
let declsForTDZ = new Set([constDecl1, constDecl3, constDecl5, constDecl7]);
let uses = [ 'constvar = 1;',
« test/mjsunit/es6/regress/regress-3938.js ('K') | « test/mjsunit/es6/regress/regress-3938.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698