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

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

Issue 1315673009: Sloppy-mode let parsing (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: clarify comment Created 5 years, 4 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
« no previous file with comments | « src/token.h ('k') | test/mjsunit/harmony/block-let-contextual-sloppy.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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));
+}
« no previous file with comments | « src/token.h ('k') | test/mjsunit/harmony/block-let-contextual-sloppy.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698