mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-18 15:32:22 +00:00
LibJS: Check that 'let' is followed by declaration before matching it
Since 'let' is a valid variable name (in non-strict mode) let may not be the start of a declaration but just an identifier.
This commit is contained in:
parent
179c48e1a4
commit
5f344f7ca3
Notes:
sideshowbarker
2024-07-18 05:54:50 +09:00
Author: https://github.com/davidot
Commit: 5f344f7ca3
Pull-request: https://github.com/SerenityOS/serenity/pull/9085
Reviewed-by: https://github.com/IdanHo
Reviewed-by: https://github.com/linusg ✅
Reviewed-by: https://github.com/trflynn89
2 changed files with 36 additions and 4 deletions
|
@ -159,8 +159,9 @@ private:
|
|||
bool match_secondary_expression(const Vector<TokenType>& forbidden = {}) const;
|
||||
bool match_statement() const;
|
||||
bool match_export_or_import() const;
|
||||
bool match_declaration() const;
|
||||
bool match_variable_declaration() const;
|
||||
bool match_declaration();
|
||||
bool try_match_let_declaration();
|
||||
bool match_variable_declaration();
|
||||
bool match_identifier() const;
|
||||
bool match_identifier_name() const;
|
||||
bool match_property_key() const;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue