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

Unified Diff: src/preparser.h

Issue 812163003: Simplify scanner and generate better error message for legacy octals in templates (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 6 years 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/scanner.cc » ('j') | test/mjsunit/harmony/templates.js » ('J')
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 3b221ac09235654af5ff7fe241b6a507e6839df7..44cd0b74f9dfd280bdc2e21614d06b8b8b82cbf4 100644
--- a/src/preparser.h
+++ b/src/preparser.h
@@ -2846,6 +2846,7 @@ ParserBase<Traits>::ParseTemplateLiteral(ExpressionT tag, int start, bool* ok) {
if (peek() == Token::TEMPLATE_TAIL) {
Consume(Token::TEMPLATE_TAIL);
int pos = position();
+ CheckOctalLiteral(pos, peek_position(), CHECK_OK);
arv (Not doing code reviews) 2014/12/18 20:38:51 CheckOctalLiteral needs to be updated to use a dif
caitp (gmail) 2014/12/18 20:44:18 Yeah --- I was undecided whether it should be some
arv (Not doing code reviews) 2014/12/18 20:46:58 I think a new error message would be best.
caitp (gmail) 2014/12/18 21:09:50 Done and done
typename Traits::TemplateLiteralState ts = Traits::OpenTemplateLiteral(pos);
Traits::AddTemplateSpan(&ts, true);
return Traits::CloseTemplateLiteral(&ts, start, tag);
@@ -2897,6 +2898,7 @@ ParserBase<Traits>::ParseTemplateLiteral(ExpressionT tag, int start, bool* ok) {
} while (next == Token::TEMPLATE_SPAN);
DCHECK_EQ(next, Token::TEMPLATE_TAIL);
+ CheckOctalLiteral(pos, peek_position(), CHECK_OK);
// Once we've reached a TEMPLATE_TAIL, we can close the TemplateLiteral.
return Traits::CloseTemplateLiteral(&ts, start, tag);
}
« no previous file with comments | « no previous file | src/scanner.cc » ('j') | test/mjsunit/harmony/templates.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698