1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 13:28:11 +00:00

LibJS: Implement 'in' operator

This commit is contained in:
Linus Groh 2020-04-23 16:06:01 +01:00 committed by Andreas Kling
parent 396ecfa2d7
commit 11728b7db5
6 changed files with 54 additions and 0 deletions

View file

@ -331,6 +331,8 @@ Value BinaryExpression::execute(Interpreter& interpreter) const
return right_shift(interpreter, lhs_result, rhs_result);
case BinaryOp::UnsignedRightShift:
return unsigned_right_shift(interpreter, lhs_result, rhs_result);
case BinaryOp::In:
return in(interpreter, lhs_result, rhs_result);
case BinaryOp::InstanceOf:
return instance_of(interpreter, lhs_result, rhs_result);
}
@ -512,6 +514,9 @@ void BinaryExpression::dump(int indent) const
case BinaryOp::UnsignedRightShift:
op_string = ">>>";
break;
case BinaryOp::In:
op_string = "in";
break;
case BinaryOp::InstanceOf:
op_string = "instanceof";
break;