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

Unified Diff: src/parsing/scanner.cc

Issue 2551633002: Change error messages for octal escape sequences (Closed)
Patch Set: Created 4 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 | « src/parsing/scanner.h ('k') | test/message/strict-octal-string.out » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parsing/scanner.cc
diff --git a/src/parsing/scanner.cc b/src/parsing/scanner.cc
index 04c655243195820a359eaaa46b1b05be542263c6..2b3823ed42df5c916eeadf57e397858a4d9cc2ff 100644
--- a/src/parsing/scanner.cc
+++ b/src/parsing/scanner.cc
@@ -79,9 +79,8 @@ Scanner::Scanner(UnicodeCache* unicode_cache)
: unicode_cache_(unicode_cache),
octal_pos_(Location::invalid()),
decimal_with_leading_zero_pos_(Location::invalid()),
- found_html_comment_(false) {
-}
-
+ octal_message_(MessageTemplate::kNone),
+ found_html_comment_(false) {}
void Scanner::Initialize(Utf16CharacterStream* source) {
source_ = source;
@@ -917,6 +916,7 @@ uc32 Scanner::ScanOctalEscape(uc32 c, int length) {
// occur before the "use strict" directive.
if (c != '0' || i > 0) {
octal_pos_ = Location(source_pos() - i - 1, source_pos() - 1);
+ octal_message_ = MessageTemplate::kStrictOctalEscape;
}
return x;
}
@@ -1130,6 +1130,7 @@ Token::Value Scanner::ScanNumber(bool seen_period) {
if (c0_ < '0' || '7' < c0_) {
// Octal literal finished.
octal_pos_ = Location(start_pos, source_pos());
+ octal_message_ = MessageTemplate::kStrictOctalLiteral;
break;
}
AddLiteralCharAdvance();
« no previous file with comments | « src/parsing/scanner.h ('k') | test/message/strict-octal-string.out » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698