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

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

Issue 1702853002: [cleanup] add Parser accessors for FLAG_harmony_function_sent (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 10 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') | no next file » | 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 9431a4d28eca974867cd534650c626cd9ca46ca2..d0aa54815ca5d6f9794e9b2a562376c7615385c5 100644
--- a/test/cctest/test-parsing.cc
+++ b/test/cctest/test-parsing.cc
@@ -1500,7 +1500,6 @@ i::Handle<i::String> FormatMessage(i::Vector<unsigned> data) {
return i::MessageTemplate::FormatMessage(isolate, message, arg_object);
}
-
enum ParserFlag {
kAllowLazy,
kAllowNatives,
@@ -1511,10 +1510,10 @@ enum ParserFlag {
kAllowHarmonyDestructuringAssignment,
kAllowHarmonyNewTarget,
kAllowStrongMode,
- kNoLegacyConst
+ kNoLegacyConst,
+ kAllowHarmonyFunctionSent
};
-
enum ParserSyncTestResult {
kSuccessOrError,
kSuccess,
@@ -1536,6 +1535,8 @@ void SetParserFlags(i::ParserBase<Traits>* parser,
flags.Contains(kAllowHarmonyDestructuringAssignment));
parser->set_allow_strong_mode(flags.Contains(kAllowStrongMode));
parser->set_allow_legacy_const(!flags.Contains(kNoLegacyConst));
+ parser->set_allow_harmony_function_sent(
+ flags.Contains(kAllowHarmonyFunctionSent));
}
@@ -8022,10 +8023,9 @@ TEST(FunctionSentErrors) {
};
// clang-format on
- bool old_flag = i::FLAG_harmony_function_sent;
- i::FLAG_harmony_function_sent = true;
- RunParserSyncTest(context_data, error_data, kError);
- i::FLAG_harmony_function_sent = old_flag;
+ static const ParserFlag always_flags[] = {kAllowHarmonyFunctionSent};
+ RunParserSyncTest(context_data, error_data, kError, always_flags,
+ arraysize(always_flags));
}
TEST(NewTargetErrors) {
« no previous file with comments | « src/parsing/parser-base.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698