From 10372b81184b00aea37d497efd13345232170cef Mon Sep 17 00:00:00 2001 From: Matthew Olsson Date: Sat, 12 Jun 2021 09:48:23 -0700 Subject: LibJS: Remove bad spread check in declaration parsing This would allow assignments such as `let ...{ a } = { a: 20 }` --- Userland/Libraries/LibJS/Parser.cpp | 6 ------ 1 file changed, 6 deletions(-) (limited to 'Userland') 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 Parser::parse_variable_declaration(bool for_l target = create_ast_node( { 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(); } -- cgit v1.2.3