Skip to content

Commit

Permalink
LibJS: Add TokenType::{Debugger,With} to Token::is_identifier_name()
Browse files Browse the repository at this point in the history
Also remove TokenType::Interface, that should be handled elsewhere (as
a 'future reserved word' in strict mode).
  • Loading branch information
linusg committed Jul 16, 2021
1 parent 52a2518 commit 510f668
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Userland/Libraries/LibJS/Token.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (c) 2020, Stephan Unverwerth <[email protected]>
* Copyright (c) 2020, Linus Groh <[email protected]>
* Copyright (c) 2020-2021, Linus Groh <[email protected]>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
Expand Down Expand Up @@ -222,6 +222,7 @@ bool Token::is_identifier_name() const
|| m_type == TokenType::Class
|| m_type == TokenType::Const
|| m_type == TokenType::Continue
|| m_type == TokenType::Debugger
|| m_type == TokenType::Default
|| m_type == TokenType::Delete
|| m_type == TokenType::Do
Expand All @@ -236,7 +237,6 @@ bool Token::is_identifier_name() const
|| m_type == TokenType::Import
|| m_type == TokenType::In
|| m_type == TokenType::Instanceof
|| m_type == TokenType::Interface
|| m_type == TokenType::Let
|| m_type == TokenType::New
|| m_type == TokenType::NullLiteral
Expand All @@ -250,6 +250,7 @@ bool Token::is_identifier_name() const
|| m_type == TokenType::Var
|| m_type == TokenType::Void
|| m_type == TokenType::While
|| m_type == TokenType::With
|| m_type == TokenType::Yield;
}

Expand Down

0 comments on commit 510f668

Please sign in to comment.