diff options
author | Linus Groh <mail@linusgroh.de> | 2020-04-23 16:06:01 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-04-23 19:38:13 +0200 |
commit | 11728b7db5e79756e5a212c7fe4a1acaf5657767 (patch) | |
tree | 5e574b603a1e500c356dfe254090cd8b38ff99d0 /Libraries/LibJS/Parser.cpp | |
parent | 396ecfa2d79be73af9de3f9a1514925e99f02dd4 (diff) | |
download | serenity-11728b7db5e79756e5a212c7fe4a1acaf5657767.zip |
LibJS: Implement 'in' operator
Diffstat (limited to 'Libraries/LibJS/Parser.cpp')
-rw-r--r-- | Libraries/LibJS/Parser.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Libraries/LibJS/Parser.cpp b/Libraries/LibJS/Parser.cpp index c58a9a3f27..b9b6cf0025 100644 --- a/Libraries/LibJS/Parser.cpp +++ b/Libraries/LibJS/Parser.cpp @@ -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 |