1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 19:47:44 +00:00

LibJS: Implement <= and >= binary operators

This commit is contained in:
Conrad Pankoff 2020-03-12 23:07:08 +11:00 committed by Andreas Kling
parent fdf7f81ba9
commit 0fe87c5fec
6 changed files with 38 additions and 0 deletions

View file

@ -125,8 +125,12 @@ Value BinaryExpression::execute(Interpreter& interpreter) const
return Value(!typed_eq(lhs_result, rhs_result).to_boolean());
case BinaryOp::GreaterThan:
return greater_than(lhs_result, rhs_result);
case BinaryOp::GreaterThanEquals:
return greater_than_equals(lhs_result, rhs_result);
case BinaryOp::LessThan:
return less_than(lhs_result, rhs_result);
case BinaryOp::LessThanEquals:
return less_than_equals(lhs_result, rhs_result);
case BinaryOp::BitwiseAnd:
return bitwise_and(lhs_result, rhs_result);
case BinaryOp::BitwiseOr:
@ -213,9 +217,15 @@ void BinaryExpression::dump(int indent) const
case BinaryOp::GreaterThan:
op_string = ">";
break;
case BinaryOp::GreaterThanEquals:
op_string = ">=";
break;
case BinaryOp::LessThan:
op_string = "<";
break;
case BinaryOp::LessThanEquals:
op_string = "<=";
break;
case BinaryOp::BitwiseAnd:
op_string = "&";
break;