mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 04:57:44 +00:00
LibJS: Implement <= and >= binary operators
This commit is contained in:
parent
fdf7f81ba9
commit
0fe87c5fec
6 changed files with 38 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue