Index: src/parsing/expression-classifier.h |
diff --git a/src/parsing/expression-classifier.h b/src/parsing/expression-classifier.h |
index f97ef310fd27145f5b3184be301c55cff34535c3..f1c2d3a23969e07b1d47e503349aa46fc450b0e9 100644 |
--- a/src/parsing/expression-classifier.h |
+++ b/src/parsing/expression-classifier.h |
@@ -285,7 +285,14 @@ class ExpressionClassifier { |
DCHECK_EQ(inner->reported_errors_, reported_errors_); |
DCHECK_EQ(inner->reported_errors_begin_, reported_errors_end_); |
DCHECK_EQ(inner->reported_errors_end_, reported_errors_->length()); |
- if (merge_non_patterns) MergeNonPatterns(inner); |
+ DCHECK_EQ(inner->non_patterns_to_rewrite_, non_patterns_to_rewrite_); |
+ DCHECK_LE(non_pattern_begin_, inner->non_pattern_begin_); |
+ DCHECK_LE(inner->non_pattern_begin_, non_patterns_to_rewrite_->length()); |
+ // Merge non-patterns from the inner classifier, or discard them. |
+ if (merge_non_patterns) |
+ inner->non_pattern_begin_ = non_patterns_to_rewrite_->length(); |
+ else |
+ non_patterns_to_rewrite_->Rewind(inner->non_pattern_begin_); |
// Propagate errors from inner, but don't overwrite already recorded |
// errors. |
unsigned non_arrow_inner_invalid_productions = |
@@ -376,11 +383,6 @@ class ExpressionClassifier { |
non_patterns_to_rewrite_->Rewind(non_pattern_begin_); |
} |
- V8_INLINE void MergeNonPatterns(ExpressionClassifier* inner) { |
- DCHECK_LE(non_pattern_begin_, inner->non_pattern_begin_); |
- inner->non_pattern_begin_ = inner->non_patterns_to_rewrite_->length(); |
- } |
- |
private: |
V8_INLINE const Error& reported_error(ErrorKind kind) const { |
if (invalid_productions_ & (1 << kind)) { |