Index: src/preparser.h |
diff --git a/src/preparser.h b/src/preparser.h |
index 9f586469583c5cc7681c6a78c8f3d05b7b3ed260..506e29daf63baca13d38724e831f9232142e9e52 100644 |
--- a/src/preparser.h |
+++ b/src/preparser.h |
@@ -2170,7 +2170,7 @@ ParserBase<Traits>::ParsePrimaryExpression(ExpressionClassifier* classifier, |
case Token::SMI: |
case Token::NUMBER: |
classifier->RecordBindingPatternError( |
- scanner()->location(), MessageTemplate::kUnexpectedTokenNumber); |
+ scanner()->peek_location(), MessageTemplate::kUnexpectedTokenNumber); |
Next(); |
result = |
this->ExpressionFromLiteral(token, beg_pos, scanner(), factory()); |
@@ -2190,17 +2190,21 @@ ParserBase<Traits>::ParsePrimaryExpression(ExpressionClassifier* classifier, |
case Token::STRING: { |
classifier->RecordBindingPatternError( |
- scanner()->location(), MessageTemplate::kUnexpectedTokenString); |
+ scanner()->peek_location(), MessageTemplate::kUnexpectedTokenString); |
Consume(Token::STRING); |
result = this->ExpressionFromString(beg_pos, scanner(), factory()); |
break; |
} |
case Token::ASSIGN_DIV: |
+ classifier->RecordBindingPatternError( |
+ scanner()->peek_location(), MessageTemplate::kUnexpectedTokenRegExp); |
result = this->ParseRegExpLiteral(true, classifier, CHECK_OK); |
break; |
case Token::DIV: |
+ classifier->RecordBindingPatternError( |
+ scanner()->peek_location(), MessageTemplate::kUnexpectedTokenRegExp); |
result = this->ParseRegExpLiteral(false, classifier, CHECK_OK); |
break; |
@@ -2302,6 +2306,9 @@ ParserBase<Traits>::ParsePrimaryExpression(ExpressionClassifier* classifier, |
case Token::TEMPLATE_SPAN: |
case Token::TEMPLATE_TAIL: |
+ classifier->RecordBindingPatternError( |
+ scanner()->peek_location(), |
+ MessageTemplate::kUnexpectedTemplateString); |
result = this->ParseTemplateLiteral(Traits::NoTemplateTag(), beg_pos, |
classifier, CHECK_OK); |
break; |