Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(682)

Unified Diff: src/preparser.h

Issue 1002263004: Beautify syntax error for unterminated argument list (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/messages.js ('k') | test/message/unterminated-arg-list.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
« no previous file with comments | « src/messages.js ('k') | test/message/unterminated-arg-list.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698