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

Unified Diff: src/parsing/scanner.cc

Issue 2510873005: A decimal integer literal with a leading 0 is now an error in strict mode. (Closed)
Patch Set: implementation without error message changes 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/test262/test262.status » ('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 2b3823ed42df5c916eeadf57e397858a4d9cc2ff..de948e0b8e372de7f5f9f8f9ec0a6a15dfc6e247 100644
--- a/src/parsing/scanner.cc
+++ b/src/parsing/scanner.cc
@@ -78,7 +78,6 @@ bool Scanner::BookmarkScope::HasBeenApplied() {
Scanner::Scanner(UnicodeCache* unicode_cache)
: unicode_cache_(unicode_cache),
octal_pos_(Location::invalid()),
- decimal_with_leading_zero_pos_(Location::invalid()),
octal_message_(MessageTemplate::kNone),
found_html_comment_(false) {}
@@ -1159,8 +1158,10 @@ Token::Value Scanner::ScanNumber(bool seen_period) {
literal.Complete();
HandleLeadSurrogate();
- if (kind == DECIMAL_WITH_LEADING_ZERO)
- decimal_with_leading_zero_pos_ = Location(start_pos, source_pos());
+ if (kind == DECIMAL_WITH_LEADING_ZERO) {
+ octal_pos_ = Location(start_pos, source_pos());
+ octal_message_ = MessageTemplate::kStrictDecimalWithLeadingZero;
+ }
return Token::SMI;
}
HandleLeadSurrogate();
@@ -1200,8 +1201,10 @@ Token::Value Scanner::ScanNumber(bool seen_period) {
literal.Complete();
- if (kind == DECIMAL_WITH_LEADING_ZERO)
- decimal_with_leading_zero_pos_ = Location(start_pos, source_pos());
+ if (kind == DECIMAL_WITH_LEADING_ZERO) {
+ octal_pos_ = Location(start_pos, source_pos());
+ octal_message_ = MessageTemplate::kStrictDecimalWithLeadingZero;
+ }
return Token::NUMBER;
}
« no previous file with comments | « src/parsing/scanner.h ('k') | test/test262/test262.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698