Chromium Code Reviews| Index: src/parsing/parser-base.h |
| diff --git a/src/parsing/parser-base.h b/src/parsing/parser-base.h |
| index 0a2bf4e45a045c2146c90f6ebcf90cdfa58070f8..c5b1d28fa9743d734c219a6f13101c4b9d6d2bdf 100644 |
| --- a/src/parsing/parser-base.h |
| +++ b/src/parsing/parser-base.h |
| @@ -933,16 +933,8 @@ class ParserBase : public Traits { |
| void ValidateBindingPattern(const ExpressionClassifier* classifier, |
| bool* ok) { |
| - if (!classifier->is_valid_binding_pattern() || |
|
caitp
2016/08/19 23:04:34
If this passes tests, it looks great. At some poin
adamk
2016/08/19 23:07:42
Yeah, that was exactly my thinking (and it seems t
|
| - !classifier->is_valid_async_binding_pattern()) { |
| - const Scanner::Location& a = classifier->binding_pattern_error().location; |
| - const Scanner::Location& b = |
| - classifier->async_binding_pattern_error().location; |
| - if (a.beg_pos < 0 || (b.beg_pos >= 0 && a.beg_pos > b.beg_pos)) { |
| - ReportClassifierError(classifier->async_binding_pattern_error()); |
| - } else { |
| - ReportClassifierError(classifier->binding_pattern_error()); |
| - } |
| + if (!classifier->is_valid_binding_pattern()) { |
| + ReportClassifierError(classifier->binding_pattern_error()); |
| *ok = false; |
| } |
| } |
| @@ -2788,12 +2780,10 @@ ParserBase<Traits>::ParseUnaryExpression(ExpressionClassifier* classifier, |
| Next(); |
| IdentifierT name = this->GetSymbol(scanner()); |
| - // Possibly async arrow formals --- record ExpressionError just in case. |
| - ExpressionUnexpectedToken(classifier); |
| - classifier->RecordAsyncBindingPatternError( |
| + classifier->RecordBindingPatternError( |
| Scanner::Location(beg_pos, scanner()->location().end_pos), |
| MessageTemplate::kAwaitBindingIdentifier); |
| - classifier->RecordAsyncArrowFormalParametersError( |
| + classifier->RecordArrowFormalParametersError( |
|
caitp
2016/08/19 23:04:34
good find!
|
| Scanner::Location(beg_pos, scanner()->location().end_pos), |
| MessageTemplate::kAwaitBindingIdentifier); |