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

Unified Diff: src/parsing/parser-base.h

Issue 2478883002: Remove always-true --harmony-restrictive-declarations flag (Closed)
Patch Set: Formatting Created 4 years, 1 month 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.cc ('k') | test/cctest/test-parsing.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parsing/parser-base.h
diff --git a/src/parsing/parser-base.h b/src/parsing/parser-base.h
index bd8a8b4882cc20a99236602377d1070b3dbbf733..8332989d5812763909adb42f95ec7a1fe7bc97f8 100644
--- a/src/parsing/parser-base.h
+++ b/src/parsing/parser-base.h
@@ -211,7 +211,6 @@ class ParserBase {
allow_lazy_(false),
allow_natives_(false),
allow_tailcalls_(false),
- allow_harmony_restrictive_declarations_(false),
allow_harmony_do_expressions_(false),
allow_harmony_function_sent_(false),
allow_harmony_async_await_(false),
@@ -226,7 +225,6 @@ class ParserBase {
ALLOW_ACCESSORS(lazy);
ALLOW_ACCESSORS(natives);
ALLOW_ACCESSORS(tailcalls);
- ALLOW_ACCESSORS(harmony_restrictive_declarations);
ALLOW_ACCESSORS(harmony_do_expressions);
ALLOW_ACCESSORS(harmony_function_sent);
ALLOW_ACCESSORS(harmony_async_await);
@@ -1463,7 +1461,6 @@ class ParserBase {
bool allow_lazy_;
bool allow_natives_;
bool allow_tailcalls_;
- bool allow_harmony_restrictive_declarations_;
bool allow_harmony_do_expressions_;
bool allow_harmony_function_sent_;
bool allow_harmony_async_await_;
@@ -3683,13 +3680,10 @@ ParserBase<Impl>::ParseFunctionDeclaration(bool* ok) {
int pos = position();
ParseFunctionFlags flags = ParseFunctionFlags::kIsNormal;
if (Check(Token::MUL)) {
- flags |= ParseFunctionFlags::kIsGenerator;
- if (allow_harmony_restrictive_declarations()) {
- impl()->ReportMessageAt(scanner()->location(),
- MessageTemplate::kGeneratorInLegacyContext);
- *ok = false;
- return impl()->NullStatement();
- }
+ impl()->ReportMessageAt(scanner()->location(),
+ MessageTemplate::kGeneratorInLegacyContext);
+ *ok = false;
+ return impl()->NullStatement();
}
return ParseHoistableDeclaration(pos, flags, nullptr, false, ok);
}
@@ -4634,8 +4628,7 @@ typename ParserBase<Impl>::BlockT ParserBase<Impl>::ParseBlock(
template <typename Impl>
typename ParserBase<Impl>::StatementT ParserBase<Impl>::ParseScopedStatement(
ZoneList<const AstRawString*>* labels, bool legacy, bool* ok) {
- if (is_strict(language_mode()) || peek() != Token::FUNCTION ||
- (legacy && allow_harmony_restrictive_declarations())) {
+ if (is_strict(language_mode()) || peek() != Token::FUNCTION || legacy) {
return ParseStatement(labels, kDisallowLabelledFunctionStatement, ok);
} else {
if (legacy) {
« no previous file with comments | « src/parsing/parser.cc ('k') | test/cctest/test-parsing.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698