diff options
author | Matthew Olsson <matthewcolsson@gmail.com> | 2021-06-12 09:48:23 -0700 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-06-19 09:38:26 +0200 |
commit | 10372b81184b00aea37d497efd13345232170cef (patch) | |
tree | 01fb2bfa3045cd488edba0a741890f0ed3989089 /Userland | |
parent | 29f9a38f767ee681a8130314aece5a00651d4b5a (diff) | |
download | serenity-10372b81184b00aea37d497efd13345232170cef.zip |
LibJS: Remove bad spread check in declaration parsing
This would allow assignments such as `let ...{ a } = { a: 20 }`
Diffstat (limited to 'Userland')
-rw-r--r-- | Userland/Libraries/LibJS/Parser.cpp | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/Userland/Libraries/LibJS/Parser.cpp b/Userland/Libraries/LibJS/Parser.cpp index 80ec1be7ac..48d286c102 100644 --- a/Userland/Libraries/LibJS/Parser.cpp +++ b/Userland/Libraries/LibJS/Parser.cpp @@ -1673,12 +1673,6 @@ NonnullRefPtr<VariableDeclaration> Parser::parse_variable_declaration(bool for_l target = create_ast_node<Identifier>( { m_parser_state.m_current_token.filename(), rule_start.position(), position() }, consume(TokenType::Identifier).value()); - } else if (match(TokenType::TripleDot)) { - consume(); - if (auto pattern = parse_binding_pattern()) - target = pattern.release_nonnull(); - else - syntax_error("Expected a binding pattern after ... in variable declaration"); } else if (auto pattern = parse_binding_pattern()) { target = pattern.release_nonnull(); } |