mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-03 23:25:20 +00:00
LibJS: Implement abstract equality and inequality
This commit is contained in:
committed by
Andreas Kling
parent
4d22a142f7
commit
dfbaa8e543
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user