Chromium Code Reviews| Index: src/parsing/parser-base.h |
| diff --git a/src/parsing/parser-base.h b/src/parsing/parser-base.h |
| index 02df5cf392f01b432d8f972849d53eddb47d6917..24bd0296886db52ff5ef6e02e0c676eaf39e340a 100644 |
| --- a/src/parsing/parser-base.h |
| +++ b/src/parsing/parser-base.h |
| @@ -854,35 +854,27 @@ class ParserBase { |
| // Checks whether an octal literal was last seen between beg_pos and end_pos. |
| // If so, reports an error. Only called for strict mode and template strings. |
| - void CheckOctalLiteral(int beg_pos, int end_pos, |
| - MessageTemplate::Template message, bool* ok) { |
| + void CheckOctalLiteral(int beg_pos, int end_pos, bool is_template_escape, |
| + bool* ok) { |
| Scanner::Location octal = scanner()->octal_position(); |
| if (octal.IsValid() && beg_pos <= octal.beg_pos && |
| octal.end_pos <= end_pos) { |
| + MessageTemplate::Template message = |
| + is_template_escape ? MessageTemplate::kTemplateOctalLiteral |
| + : scanner()->octal_message(); |
| + DCHECK_NE(message, MessageTemplate::kNone); |
|
Dan Ehrenberg
2016/11/18 17:13:51
IMO it wouldn't hurt to continue updating the UseC
|
| impl()->ReportMessageAt(octal, message); |
| scanner()->clear_octal_position(); |
| *ok = false; |
| } |
| } |
| - // for now, this check just collects statistics. |
| - void CheckDecimalLiteralWithLeadingZero(int beg_pos, int end_pos) { |
| - Scanner::Location token_location = |
| - scanner()->decimal_with_leading_zero_position(); |
| - if (token_location.IsValid() && beg_pos <= token_location.beg_pos && |
| - token_location.end_pos <= end_pos) { |
| - scanner()->clear_decimal_with_leading_zero_position(); |
| - impl()->CountUsage(v8::Isolate::kDecimalWithLeadingZeroInStrictMode); |
| - } |
| - } |
| inline void CheckStrictOctalLiteral(int beg_pos, int end_pos, bool* ok) { |
| - CheckOctalLiteral(beg_pos, end_pos, MessageTemplate::kStrictOctalLiteral, |
| - ok); |
| + CheckOctalLiteral(beg_pos, end_pos, false, ok); |
| } |
| inline void CheckTemplateOctalLiteral(int beg_pos, int end_pos, bool* ok) { |
| - CheckOctalLiteral(beg_pos, end_pos, MessageTemplate::kTemplateOctalLiteral, |
| - ok); |
| + CheckOctalLiteral(beg_pos, end_pos, true, ok); |
| } |
| void CheckDestructuringElement(ExpressionT element, int beg_pos, int end_pos); |