| Index: src/scanner.h
|
| diff --git a/src/scanner.h b/src/scanner.h
|
| index 6d0d4dc8eddb52022f67cb1cdb01273695666373..ea4f74c1f71a5aa758c8871b05fe5c520b6bf446 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);
|
| @@ -394,6 +391,8 @@ class Scanner {
|
| const AstRawString* NextSymbol(AstValueFactory* ast_value_factory);
|
| const AstRawString* CurrentRawSymbol(AstValueFactory* ast_value_factory);
|
|
|
| + bool IsNextEscapedReservedWord(LanguageMode language_mode, bool is_generator);
|
| +
|
| double DoubleValue();
|
| bool ContainsDot();
|
| bool LiteralMatches(const char* data, int length, bool allow_escapes = true) {
|
| @@ -689,6 +688,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.
|
|
|