diff options
Diffstat (limited to 'deps/v8/src/parsing/scanner-inl.h')
-rw-r--r-- | deps/v8/src/parsing/scanner-inl.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/deps/v8/src/parsing/scanner-inl.h b/deps/v8/src/parsing/scanner-inl.h index fc5194f263f..bd4d0284d86 100644 --- a/deps/v8/src/parsing/scanner-inl.h +++ b/deps/v8/src/parsing/scanner-inl.h @@ -364,14 +364,14 @@ V8_INLINE Token::Value Scanner::ScanSingleToken() { return Select(token); case Token::CONDITIONAL: - // ? ?. ?? + // ? ?. ?? ??= Advance(); - if (V8_UNLIKELY(allow_harmony_optional_chaining() && c0_ == '.')) { + if (c0_ == '.') { Advance(); if (!IsDecimalDigit(c0_)) return Token::QUESTION_PERIOD; PushBack('.'); - } else if (V8_UNLIKELY(allow_harmony_nullish() && c0_ == '?')) { - return Select(Token::NULLISH); + } else if (c0_ == '?') { + return Select('=', Token::ASSIGN_NULLISH, Token::NULLISH); } return Token::CONDITIONAL; @@ -471,16 +471,16 @@ V8_INLINE Token::Value Scanner::ScanSingleToken() { return Token::DIV; case Token::BIT_AND: - // & && &= + // & && &= &&= Advance(); - if (c0_ == '&') return Select(Token::AND); + if (c0_ == '&') return Select('=', Token::ASSIGN_AND, Token::AND); if (c0_ == '=') return Select(Token::ASSIGN_BIT_AND); return Token::BIT_AND; case Token::BIT_OR: - // | || |= + // | || |= ||= Advance(); - if (c0_ == '|') return Select(Token::OR); + if (c0_ == '|') return Select('=', Token::ASSIGN_OR, Token::OR); if (c0_ == '=') return Select(Token::ASSIGN_BIT_OR); return Token::BIT_OR; |