Index: src/parsing/parser-base.h |
diff --git a/src/parsing/parser-base.h b/src/parsing/parser-base.h |
index 86e4826ddfee58787d056b831f6616d5bab14526..2c8a62ef83739297996e2e8f42683fe1692ed34f 100644 |
--- a/src/parsing/parser-base.h |
+++ b/src/parsing/parser-base.h |
@@ -992,27 +992,23 @@ template <class Traits> |
void ParserBase<Traits>::GetUnexpectedTokenMessage( |
Token::Value token, MessageTemplate::Template* message, const char** arg, |
MessageTemplate::Template default_) { |
+ *arg = nullptr; |
switch (token) { |
case Token::EOS: |
*message = MessageTemplate::kUnexpectedEOS; |
- *arg = nullptr; |
break; |
case Token::SMI: |
case Token::NUMBER: |
*message = MessageTemplate::kUnexpectedTokenNumber; |
- *arg = nullptr; |
break; |
case Token::STRING: |
*message = MessageTemplate::kUnexpectedTokenString; |
- *arg = nullptr; |
break; |
case Token::IDENTIFIER: |
*message = MessageTemplate::kUnexpectedTokenIdentifier; |
- *arg = nullptr; |
break; |
case Token::FUTURE_RESERVED_WORD: |
*message = MessageTemplate::kUnexpectedReserved; |
- *arg = nullptr; |
break; |
case Token::LET: |
case Token::STATIC: |
@@ -1021,17 +1017,17 @@ void ParserBase<Traits>::GetUnexpectedTokenMessage( |
*message = is_strict(language_mode()) |
? MessageTemplate::kUnexpectedStrictReserved |
: MessageTemplate::kUnexpectedTokenIdentifier; |
- *arg = nullptr; |
break; |
case Token::TEMPLATE_SPAN: |
case Token::TEMPLATE_TAIL: |
*message = MessageTemplate::kUnexpectedTemplateString; |
- *arg = nullptr; |
break; |
case Token::ESCAPED_STRICT_RESERVED_WORD: |
case Token::ESCAPED_KEYWORD: |
*message = MessageTemplate::kInvalidEscapedReservedWord; |
- *arg = nullptr; |
+ break; |
+ case Token::ILLEGAL: |
+ *message = MessageTemplate::kInvalidOrUnexpectedToken; |
break; |
default: |
const char* name = Token::String(token); |