| Index: src/scanner.h
|
| diff --git a/src/scanner.h b/src/scanner.h
|
| index 6d0d4dc8eddb52022f67cb1cdb01273695666373..ab5693ee5a5c3fc889ec2cec80561fa61c29ae9e 100644
|
| --- a/src/scanner.h
|
| +++ b/src/scanner.h
|
| @@ -373,13 +373,10 @@ class Scanner {
|
| Location peek_location() const { return next_.location; }
|
|
|
| bool literal_contains_escapes() const {
|
| - Location location = current_.location;
|
| - int source_length = (location.end_pos - location.beg_pos);
|
| - if (current_.token == Token::STRING) {
|
| - // Subtract delimiters.
|
| - source_length -= 2;
|
| - }
|
| - return current_.literal_chars->length() != source_length;
|
| + return LiteralContainsEscapes(current_);
|
| + }
|
| + bool next_literal_contains_escapes() const {
|
| + return LiteralContainsEscapes(next_);
|
| }
|
| bool is_literal_contextual_keyword(Vector<const char> keyword) {
|
| DCHECK_NOT_NULL(current_.literal_chars);
|
| @@ -665,7 +662,7 @@ class Scanner {
|
| void ScanDecimalDigits();
|
| Token::Value ScanNumber(bool seen_period);
|
| Token::Value ScanIdentifierOrKeyword();
|
| - Token::Value ScanIdentifierSuffix(LiteralScope* literal);
|
| + Token::Value ScanIdentifierSuffix(LiteralScope* literal, bool escaped);
|
|
|
| Token::Value ScanString();
|
|
|
| @@ -689,6 +686,16 @@ class Scanner {
|
| return static_cast<int>(source_->pos()) - kCharacterLookaheadBufferSize;
|
| }
|
|
|
| + static bool LiteralContainsEscapes(const TokenDesc& token) {
|
| + Location location = token.location;
|
| + int source_length = (location.end_pos - location.beg_pos);
|
| + if (token.token == Token::STRING) {
|
| + // Subtract delimiters.
|
| + source_length -= 2;
|
| + }
|
| + return token.literal_chars->length() != source_length;
|
| + }
|
| +
|
| UnicodeCache* unicode_cache_;
|
|
|
| // Buffers collecting literal strings, numbers, etc.
|
|
|