mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-22 12:35:14 +00:00
LibJS: Add missing reserved words to Token::is_identifier_name()
This is being used in match_identifier_name(), for example when parsing property keys - the list was incomplete, likely as some token types were added later, leading to some unexpected syntax errors: > var e = {}; undefined > e.extends = "a"; e.extends = "a"; ^ Uncaught exception: [SyntaxError]: Unexpected token Extends. Expected IdentifierName (line: 1, column: 3) Fixes #3128.
This commit is contained in:
parent
0950fd1438
commit
d1d9545875
Notes:
sideshowbarker
2024-07-19 03:39:30 +09:00
Author: https://github.com/linusg Commit: https://github.com/SerenityOS/serenity/commit/d1d95458759 Pull-request: https://github.com/SerenityOS/serenity/pull/3131 Issue: https://github.com/SerenityOS/serenity/issues/3128
1 changed files with 5 additions and 0 deletions
|
@ -217,10 +217,14 @@ bool Token::is_identifier_name() const
|
|||
|| m_type == TokenType::Delete
|
||||
|| m_type == TokenType::Do
|
||||
|| m_type == TokenType::Else
|
||||
|| m_type == TokenType::Enum
|
||||
|| m_type == TokenType::Export
|
||||
|| m_type == TokenType::Extends
|
||||
|| m_type == TokenType::Finally
|
||||
|| m_type == TokenType::For
|
||||
|| m_type == TokenType::Function
|
||||
|| m_type == TokenType::If
|
||||
|| m_type == TokenType::Import
|
||||
|| m_type == TokenType::In
|
||||
|| m_type == TokenType::Instanceof
|
||||
|| m_type == TokenType::Interface
|
||||
|
@ -228,6 +232,7 @@ bool Token::is_identifier_name() const
|
|||
|| m_type == TokenType::New
|
||||
|| m_type == TokenType::NullLiteral
|
||||
|| m_type == TokenType::Return
|
||||
|| m_type == TokenType::Super
|
||||
|| m_type == TokenType::Switch
|
||||
|| m_type == TokenType::This
|
||||
|| m_type == TokenType::Throw
|
||||
|
|
Loading…
Add table
Reference in a new issue