Index: src/parsing/expression-classifier.h |
diff --git a/src/parsing/expression-classifier.h b/src/parsing/expression-classifier.h |
index 8e13d0e503756a4c841919348590e7abb302e31d..9e689aecbf854cbd5d3da022c89d1ab86c96d8a5 100644 |
--- a/src/parsing/expression-classifier.h |
+++ b/src/parsing/expression-classifier.h |
@@ -250,6 +250,19 @@ class ExpressionClassifier { |
Add(Error(loc, message, kBindingPatternProduction, arg)); |
} |
+ void ReplaceBindingPatternError(const Scanner::Location& loc, |
+ MessageTemplate::Template message, |
+ const char* arg = nullptr) { |
+ if (!is_valid_binding_pattern()) { |
+ Error& e = reported_error(kBindingPatternProduction); |
+ e.location = loc; |
+ e.message = message; |
+ e.arg = arg; |
+ } else { |
+ RecordBindingPatternError(loc, message, arg); |
+ } |
+ } |
+ |
void RecordAssignmentPatternError(const Scanner::Location& loc, |
MessageTemplate::Template message, |
const char* arg = nullptr) { |