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

Unified Diff: test/mjsunit/for.js

Issue 2694003002: Raise SyntaxError on let [ starting an ExpressionStatement (Closed)
Patch Set: Created 3 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/for.js
diff --git a/test/mjsunit/for.js b/test/mjsunit/for.js
index 0b7158086f4e7a4e6e31cb6e556ad9bc1448ead7..2aaabbf3b298b7ebb86ca81385c8d73f354a282e 100644
--- a/test/mjsunit/for.js
+++ b/test/mjsunit/for.js
@@ -30,3 +30,6 @@ for (var i = 0; ; i++) {
if (i > 100) break;
}
assertEquals(101, i);
+
+// Initializer of a for statement must not start with "let [".
+assertThrows("for (let [x] = [42]; false; );", SyntaxError);

Powered by Google App Engine
This is Rietveld 408576698