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

Unified Diff: src/preparser.h

Issue 808793004: Check for octals in template spans only, not expressions (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
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 | test/mjsunit/harmony/templates.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 18004a5096d4c20f0ea81470c4a2f69681289fbb..2ffd3580225ec79371ba90c7e1e10535d42f44b3 100644
--- a/src/preparser.h
+++ b/src/preparser.h
@@ -2874,6 +2874,7 @@ ParserBase<Traits>::ParseTemplateLiteral(ExpressionT tag, int start, bool* ok) {
// case, representing a TemplateMiddle).
do {
+ CheckTemplateOctalLiteral(pos, peek_position(), CHECK_OK);
next = peek();
if (!next) {
ReportMessageAt(Scanner::Location(start, peek_position()),
@@ -2897,10 +2898,10 @@ ParserBase<Traits>::ParseTemplateLiteral(ExpressionT tag, int start, bool* ok) {
// TEMPLATE_SPAN or TEMPLATE_TAIL.
next = scanner()->ScanTemplateContinuation();
Next();
+ pos = position();
if (!next) {
- ReportMessageAt(Scanner::Location(start, position()),
- "unterminated_template");
+ ReportMessageAt(Scanner::Location(start, pos), "unterminated_template");
*ok = false;
return Traits::EmptyExpression();
}
« no previous file with comments | « no previous file | test/mjsunit/harmony/templates.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698