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

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 a17296349b362df6afefbb5b8538d7c030915270..a580a47d8639ecd92fc53f42b2115c5b78dd8468 100644
--- a/src/preparser.h
+++ b/src/preparser.h
@@ -2319,8 +2319,13 @@ typename Traits::Type::ExpressionList ParserBase<Traits>::ParseArguments(
}
done = (peek() == Token::RPAREN);
Yang 2015/03/16 07:24:33 I think it's cleaner and easier to read if we chec
yurys 2015/03/16 08:56:23 Done.
if (!done) {
- // Need {} because of the CHECK_OK_CUSTOM macro.
- Expect(Token::COMMA, CHECK_OK_CUSTOM(NullExpressionList));
+ Scanner::Location location = scanner_->location();
+ Token::Value next = Next();
+ if (Token::COMMA != next) {
+ ReportMessageAt(location, "unterminated_arg_list");
+ *ok = false;
+ return this->NullExpressionList();
+ }
}
}
Expect(Token::RPAREN, CHECK_OK_CUSTOM(NullExpressionList));
Yang 2015/03/16 07:24:33 ... check for Token::LPAREN here, throwing untermi
yurys 2015/03/16 08:56:23 Done.
« 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