summaryrefslogtreecommitdiff
path: root/Userland
diff options
context:
space:
mode:
authorLinus Groh <mail@linusgroh.de>2021-07-16 19:06:05 +0100
committerLinus Groh <mail@linusgroh.de>2021-07-16 21:59:13 +0100
commit510f668ae3b648f782e9f967c6dfdc941333721b (patch)
treee8be3e7f4da3d3fc565fb975026e2c8163180815 /Userland
parent52a2518a69a12ff951f3c39d0bb8f1e3f2d2b0e8 (diff)
downloadserenity-510f668ae3b648f782e9f967c6dfdc941333721b.zip
LibJS: Add TokenType::{Debugger,With} to Token::is_identifier_name()
Also remove TokenType::Interface, that should be handled elsewhere (as a 'future reserved word' in strict mode).
Diffstat (limited to 'Userland')
-rw-r--r--Userland/Libraries/LibJS/Token.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/Userland/Libraries/LibJS/Token.cpp b/Userland/Libraries/LibJS/Token.cpp
index 6f2b0ebde0..44b4859b71 100644
--- a/Userland/Libraries/LibJS/Token.cpp
+++ b/Userland/Libraries/LibJS/Token.cpp
@@ -1,6 +1,6 @@
/*
* Copyright (c) 2020, Stephan Unverwerth <s.unverwerth@serenityos.org>
- * Copyright (c) 2020, Linus Groh <linusg@serenityos.org>
+ * Copyright (c) 2020-2021, Linus Groh <linusg@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
@@ -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
@@ -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
@@ -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;
}