1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-03 05:32:13 +00:00

LibJS: New expressions look for expressions with correct precedence

This commit is contained in:
Matthew Olsson 2020-05-28 15:10:22 -07:00 committed by Andreas Kling
parent 688ca7b196
commit 5cd01ed79e
2 changed files with 52 additions and 2 deletions

View file

@ -893,8 +893,7 @@ NonnullRefPtr<NewExpression> Parser::parse_new_expression()
{
consume(TokenType::New);
// FIXME: Support full expressions as the callee as well.
auto callee = create_ast_node<Identifier>(consume(TokenType::Identifier).value());
auto callee = parse_expression(g_operator_precedence.get(TokenType::New).value(), Associativity::Right, { TokenType::ParenOpen });
Vector<CallExpression::Argument> arguments;