mirror of
https://github.com/RGBCube/serenity
synced 2025-07-24 22:17:42 +00:00
LibJS: Implement abstract equality and inequality
This commit is contained in:
parent
4d22a142f7
commit
dfbaa8e543
6 changed files with 64 additions and 2 deletions
|
@ -155,7 +155,11 @@ Value BinaryExpression::execute(Interpreter& interpreter) const
|
|||
case BinaryOp::TypedEquals:
|
||||
return typed_eq(lhs_result, rhs_result);
|
||||
case BinaryOp::TypedInequals:
|
||||
return Value(!typed_eq(lhs_result, rhs_result).to_boolean());
|
||||
return Value(!typed_eq(lhs_result, rhs_result).as_bool());
|
||||
case BinaryOp::AbstractEquals:
|
||||
return eq(lhs_result, rhs_result);
|
||||
case BinaryOp::AbstractInequals:
|
||||
return Value(!eq(lhs_result, rhs_result).as_bool());
|
||||
case BinaryOp::GreaterThan:
|
||||
return greater_than(lhs_result, rhs_result);
|
||||
case BinaryOp::GreaterThanEquals:
|
||||
|
@ -247,6 +251,12 @@ void BinaryExpression::dump(int indent) const
|
|||
case BinaryOp::TypedInequals:
|
||||
op_string = "!==";
|
||||
break;
|
||||
case BinaryOp::AbstractEquals:
|
||||
op_string = "==";
|
||||
break;
|
||||
case BinaryOp::AbstractInequals:
|
||||
op_string = "!=";
|
||||
break;
|
||||
case BinaryOp::GreaterThan:
|
||||
op_string = ">";
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue