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

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

Issue 2407863003: Remove --harmony-for-in flag which is always false (Closed)
Patch Set: Migrate tests Created 4 years, 2 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/parsing/parser-base.h ('k') | test/mjsunit/for-in.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 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) {
« no previous file with comments | « src/parsing/parser-base.h ('k') | test/mjsunit/for-in.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698