Index: test/cctest/test-parsing.cc |
diff --git a/test/cctest/test-parsing.cc b/test/cctest/test-parsing.cc |
index 00d03ef3a7a30a60e1f607ba250741da9cba1af5..ca9019e4f54a20ee6b2103783609cdb28deb6b42 100644 |
--- a/test/cctest/test-parsing.cc |
+++ b/test/cctest/test-parsing.cc |
@@ -1298,7 +1298,6 @@ enum ParserFlag { |
kAllowNatives, |
kAllowHarmonyFunctionSent, |
kAllowHarmonyRestrictiveDeclarations, |
- kAllowHarmonyForIn, |
kAllowHarmonyAsyncAwait, |
kAllowHarmonyRestrictiveGenerators, |
kAllowHarmonyTrailingCommas, |
@@ -1320,7 +1319,6 @@ void SetParserFlags(i::ParserBase<Traits>* parser, |
flags.Contains(kAllowHarmonyFunctionSent)); |
parser->set_allow_harmony_restrictive_declarations( |
flags.Contains(kAllowHarmonyRestrictiveDeclarations)); |
- parser->set_allow_harmony_for_in(flags.Contains(kAllowHarmonyForIn)); |
parser->set_allow_harmony_async_await( |
flags.Contains(kAllowHarmonyAsyncAwait)); |
parser->set_allow_harmony_restrictive_generators( |
@@ -8116,22 +8114,29 @@ TEST(AsyncAwaitModuleErrors) { |
TEST(RestrictiveForInErrors) { |
// clang-format off |
- const char* context_data[][2] = { |
+ const char* strict_context_data[][2] = { |
{ "'use strict'", "" }, |
+ { NULL, NULL } |
+ }; |
+ const char* sloppy_context_data[][2] = { |
{ "", "" }, |
{ NULL, NULL } |
}; |
const char* error_data[] = { |
- "for (var x = 0 in {});", |
"for (const x = 0 in {});", |
"for (let x = 0 in {});", |
NULL |
}; |
+ const char* sloppy_data[] = { |
+ "for (var x = 0 in {});", |
+ NULL |
+ }; |
// clang-format on |
- static const ParserFlag always_flags[] = {kAllowHarmonyForIn}; |
- RunParserSyncTest(context_data, error_data, kError, nullptr, 0, always_flags, |
- arraysize(always_flags)); |
+ RunParserSyncTest(strict_context_data, error_data, kError); |
+ RunParserSyncTest(strict_context_data, sloppy_data, kError); |
+ RunParserSyncTest(sloppy_context_data, error_data, kError); |
+ RunParserSyncTest(sloppy_context_data, sloppy_data, kSuccess); |
} |
TEST(NoDuplicateGeneratorsInBlock) { |