Index: src/preparser.h |
diff --git a/src/preparser.h b/src/preparser.h |
index 12203d6c105f115b0fa37495e6f590ffa3c053ed..17247e88307f93feaf58bf7f9eedd694264b0ede 100644 |
--- a/src/preparser.h |
+++ b/src/preparser.h |
@@ -2324,13 +2324,17 @@ typename Traits::Type::ExpressionList ParserBase<Traits>::ParseArguments( |
*ok = false; |
return this->NullExpressionList(); |
} |
- done = (peek() == Token::RPAREN); |
+ done = (peek() != Token::COMMA); |
if (!done) { |
- // Need {} because of the CHECK_OK_CUSTOM macro. |
- Expect(Token::COMMA, CHECK_OK_CUSTOM(NullExpressionList)); |
+ Next(); |
} |
} |
- Expect(Token::RPAREN, CHECK_OK_CUSTOM(NullExpressionList)); |
+ Scanner::Location location = scanner_->location(); |
+ if (Token::RPAREN != Next()) { |
+ ReportMessageAt(location, "unterminated_arg_list"); |
+ *ok = false; |
+ return this->NullExpressionList(); |
+ } |
return result; |
} |