Index: test/cctest/test-parsing.cc |
diff --git a/test/cctest/test-parsing.cc b/test/cctest/test-parsing.cc |
index 2f42eadc84fba4774f810db86765090a8e7351cb..a36bd92763270a4b839b43d5e5a9ead34f645b7b 100644 |
--- a/test/cctest/test-parsing.cc |
+++ b/test/cctest/test-parsing.cc |
@@ -4432,3 +4432,28 @@ TEST(ScanUnterminatedTemplateLiterals) { |
RunParserSyncTest(context_data, data, kError, NULL, 0, always_flags, |
arraysize(always_flags)); |
} |
+ |
+ |
+TEST(LexicalScopingSloppyMode) { |
+ const char* context_data[][2] = { |
+ {"", ""}, |
+ {"function f() {", "}"}, |
+ {"{", "}"}, |
+ {NULL, NULL}}; |
+ const char* bad_data[] = { |
+ "let x = 1;", |
+ "for(let x = 1;;){}", |
+ "for(let x of []){}", |
+ "for(let x in []){}", |
+ NULL}; |
+ static const ParserFlag always_flags[] = {kAllowHarmonyScoping}; |
+ RunParserSyncTest(context_data, bad_data, kError, NULL, 0, always_flags, |
+ arraysize(always_flags)); |
+ |
+ const char* good_data[] = { |
+ "let = 1;", |
+ "for(let = 1;;){}", |
+ NULL}; |
+ RunParserSyncTest(context_data, good_data, kSuccess, NULL, 0, always_flags, |
+ arraysize(always_flags)); |
+} |