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)); |
+} |