| Index: src/parsing/scanner.cc
|
| diff --git a/src/parsing/scanner.cc b/src/parsing/scanner.cc
|
| index cfc0410b83cc77cbb78984aba151113d94429633..fd8669a0f9e35ac2606de403c245a97acaa03325 100644
|
| --- a/src/parsing/scanner.cc
|
| +++ b/src/parsing/scanner.cc
|
| @@ -78,10 +78,8 @@ bool Scanner::BookmarkScope::HasBeenApplied() {
|
| 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 +915,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 +1129,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();
|
| @@ -1157,8 +1157,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::kStrictOctalLiteral;
|
| + }
|
| return Token::SMI;
|
| }
|
| HandleLeadSurrogate();
|
| @@ -1198,8 +1200,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::kStrictOctalLiteral;
|
| + }
|
| return Token::NUMBER;
|
| }
|
|
|
|
|