mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-03 15:16:14 +00:00
LibJS: Implement 'in' operator
This commit is contained in:
committed by
Andreas Kling
parent
396ecfa2d7
commit
11728b7db5
@@ -566,6 +566,9 @@ NonnullRefPtr<Expression> Parser::parse_secondary_expression(NonnullRefPtr<Expre
|
||||
case TokenType::ExclamationMarkEquals:
|
||||
consume();
|
||||
return create_ast_node<BinaryExpression>(BinaryOp::AbstractInequals, move(lhs), parse_expression(min_precedence, associativity));
|
||||
case TokenType::In:
|
||||
consume();
|
||||
return create_ast_node<BinaryExpression>(BinaryOp::In, move(lhs), parse_expression(min_precedence, associativity));
|
||||
case TokenType::Instanceof:
|
||||
consume();
|
||||
return create_ast_node<BinaryExpression>(BinaryOp::InstanceOf, move(lhs), parse_expression(min_precedence, associativity));
|
||||
@@ -1076,6 +1079,7 @@ bool Parser::match_secondary_expression() const
|
||||
|| type == TokenType::BracketOpen
|
||||
|| type == TokenType::PlusPlus
|
||||
|| type == TokenType::MinusMinus
|
||||
|| type == TokenType::In
|
||||
|| type == TokenType::Instanceof
|
||||
|| type == TokenType::QuestionMark
|
||||
|| type == TokenType::Ampersand
|
||||
|
||||
Reference in New Issue
Block a user