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

Unified Diff: src/preparser.h

Issue 861173005: Version 4.1.0.11 (cherry-pick) (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@4.1
Patch Set: Created 5 years, 11 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 | « no previous file | src/version.cc » ('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 18004a5096d4c20f0ea81470c4a2f69681289fbb..e3868ff665a088efa431b4ba025fb82cf3d3d3e0 100644
--- a/src/preparser.h
+++ b/src/preparser.h
@@ -2875,11 +2875,17 @@ ParserBase<Traits>::ParseTemplateLiteral(ExpressionT tag, int start, bool* ok) {
do {
next = peek();
- if (!next) {
+ if (next == Token::EOS) {
ReportMessageAt(Scanner::Location(start, peek_position()),
"unterminated_template");
*ok = false;
return Traits::EmptyExpression();
+ } else if (next == Token::ILLEGAL) {
+ Traits::ReportMessageAt(
+ Scanner::Location(position() + 1, peek_position()),
+ "unexpected_token", "ILLEGAL", false);
+ *ok = false;
+ return Traits::EmptyExpression();
}
int expr_pos = peek_position();
@@ -2898,11 +2904,17 @@ ParserBase<Traits>::ParseTemplateLiteral(ExpressionT tag, int start, bool* ok) {
next = scanner()->ScanTemplateContinuation();
Next();
- if (!next) {
+ if (next == Token::EOS) {
ReportMessageAt(Scanner::Location(start, position()),
"unterminated_template");
*ok = false;
return Traits::EmptyExpression();
+ } else if (next == Token::ILLEGAL) {
+ Traits::ReportMessageAt(
+ Scanner::Location(position() + 1, peek_position()),
+ "unexpected_token", "ILLEGAL", false);
+ *ok = false;
+ return Traits::EmptyExpression();
}
Traits::AddTemplateSpan(&ts, next == Token::TEMPLATE_TAIL);
« no previous file with comments | « no previous file | src/version.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698