mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 15:38:10 +00:00
LibJS: Remove bad spread check in declaration parsing
This would allow assignments such as `let ...{ a } = { a: 20 }`
This commit is contained in:
parent
29f9a38f76
commit
10372b8118
1 changed files with 0 additions and 6 deletions
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue