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

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

Issue 2268173005: Merge ExpressionClassifier::ObjectLiteralProduction into ExpressionProduction (Closed)
Patch Set: Rebased Created 4 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/parsing/expression-classifier.h ('k') | no next file » | 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 c991d47ef9d4e550b2511d70baa2d25ea090516f..f66369bec641764676b1684d3321b0c13a19bf3b 100644
--- a/src/parsing/parser-base.h
+++ b/src/parsing/parser-base.h
@@ -925,16 +925,8 @@ class ParserBase : public ParserBaseTraits<Impl> {
}
void ValidateExpression(const ExpressionClassifier* classifier, bool* ok) {
- if (!classifier->is_valid_expression() ||
- classifier->has_object_literal_error()) {
- const Scanner::Location& a = classifier->expression_error().location;
- const Scanner::Location& b =
- classifier->object_literal_error().location;
- if (a.beg_pos < 0 || (b.beg_pos >= 0 && a.beg_pos > b.beg_pos)) {
- ReportClassifierError(classifier->object_literal_error());
- } else {
- ReportClassifierError(classifier->expression_error());
- }
+ if (!classifier->is_valid_expression()) {
+ ReportClassifierError(classifier->expression_error());
*ok = false;
}
}
@@ -2035,7 +2027,7 @@ ParserBase<Impl>::ParsePropertyDefinition(
classifier->AccumulateFormalParameterContainmentErrors(&rhs_classifier);
value = factory()->NewAssignment(Token::ASSIGN, lhs, rhs,
kNoSourcePosition);
- classifier->RecordObjectLiteralError(
+ classifier->RecordExpressionError(
Scanner::Location(next_beg_pos, scanner()->location().end_pos),
MessageTemplate::kInvalidCoverInitializedName);
@@ -2416,7 +2408,6 @@ ParserBase<Impl>::ParseAssignmentExpression(bool accept_IN,
// This is definitely not an expression so don't accumulate
// expression-related errors.
productions &= ~(ExpressionClassifier::ExpressionProduction |
- ExpressionClassifier::ObjectLiteralProduction |
ExpressionClassifier::TailCallExpressionProduction);
}
@@ -3668,8 +3659,8 @@ void ParserBase<Impl>::ObjectLiteralChecker::CheckProperty(
if (type == kValueProperty && IsProto()) {
if (has_seen_proto_) {
- classifier->RecordObjectLiteralError(
- this->scanner()->location(), MessageTemplate::kDuplicateProto);
+ classifier->RecordExpressionError(this->scanner()->location(),
+ MessageTemplate::kDuplicateProto);
return;
}
has_seen_proto_ = true;
« no previous file with comments | « src/parsing/expression-classifier.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698