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

Unified Diff: test/cctest/test-parsing.cc

Issue 931223002: [strong] deprecate empty sub-statements (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Another rebase & merge conflicts 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/cctest/test-parsing.cc
diff --git a/test/cctest/test-parsing.cc b/test/cctest/test-parsing.cc
index f0c3703b99819c7697c303023e4362cb53804fd7..95ce793405b9d28f74175ccfb0a564796519ed3a 100644
--- a/test/cctest/test-parsing.cc
+++ b/test/cctest/test-parsing.cc
@@ -5517,3 +5517,33 @@ TEST(VarForbiddenInStrongMode) {
RunParserSyncTest(sloppy_context_data, let_declarations, kError, NULL, 0,
always_flags, arraysize(always_flags));
}
+
+
+TEST(StrongEmptySubStatements) {
+ const char* sloppy_context_data[][2] = {{"", ""}, {NULL}};
+ const char* strict_context_data[][2] = {{"'use strict';", ""}, {NULL}};
+ const char* strong_context_data[][2] = {{"'use strong';", ""}, {NULL}};
+
+ const char* data[] = {
+ "if (1);",
+ "if (1) {} else;",
+ "while (1);",
+ "do; while (1);",
+ "for (;;);",
+ "for (x in []);",
+ "for (x of []);",
+ "for (const x = 0;;);",
+ "for (const x in []);",
+ "for (const x of []);",
+ NULL};
+
+ static const ParserFlag always_flags[] = {
+ kAllowStrongMode, kAllowHarmonyScoping
+ };
+ RunParserSyncTest(sloppy_context_data, data, kSuccess, NULL, 0, always_flags,
+ arraysize(always_flags));
+ RunParserSyncTest(strict_context_data, data, kSuccess, NULL, 0, always_flags,
+ arraysize(always_flags));
+ RunParserSyncTest(strong_context_data, data, kError, NULL, 0, always_flags,
+ arraysize(always_flags));
+}

Powered by Google App Engine
This is Rietveld 408576698