Index: test/cctest/test-parsing.cc |
diff --git a/test/cctest/test-parsing.cc b/test/cctest/test-parsing.cc |
index 1ea550caab1dc65b1fe0f320531bb250748c604d..aa3194df1f8f2c9d102ca6ff12dffede226c3a24 100644 |
--- a/test/cctest/test-parsing.cc |
+++ b/test/cctest/test-parsing.cc |
@@ -7012,3 +7012,32 @@ TEST(LanguageModeDirectivesNonSimpleParameterListErrors) { |
RunParserSyncTest(context_data, data, kError, NULL, 0, always_flags, |
arraysize(always_flags)); |
} |
+ |
+ |
+TEST(LetSloppyOnly) { |
+ // clang-format off |
+ const char* context_data[][2] = { |
+ {"", ""}, |
+ {"{", "}"}, |
+ {NULL, NULL} |
+ }; |
+ |
+ const char* data[] = { |
+ "let let", |
+ "let", |
+ "let let = 1", |
+ "let = 1", |
+ "for (let let = 1; let < 1; let++) {}", |
+ "for (let = 1; let < 1; let++) {}", |
+ "for (let let in {}) {}", |
+ "for (let let of []) {}", |
+ "for (let in {}) {}", |
+ NULL |
+ }; |
+ // clang-format on |
+ |
+ static const ParserFlag always_flags[] = {kAllowHarmonySloppy, |
+ kAllowHarmonySloppyLet}; |
+ RunParserSyncTest(context_data, data, kSuccess, NULL, 0, always_flags, |
+ arraysize(always_flags)); |
+} |