mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 08:36:15 +00:00
LibJS: Add basic support for modulo (%) in binary expressions
This commit is contained in:
@@ -244,6 +244,8 @@ Value BinaryExpression::execute(Interpreter& interpreter) const
|
||||
return mul(lhs_result, rhs_result);
|
||||
case BinaryOp::Slash:
|
||||
return div(lhs_result, rhs_result);
|
||||
case BinaryOp::Modulo:
|
||||
return mod(lhs_result, rhs_result);
|
||||
case BinaryOp::TypedEquals:
|
||||
return typed_eq(lhs_result, rhs_result);
|
||||
case BinaryOp::TypedInequals:
|
||||
@@ -379,6 +381,9 @@ void BinaryExpression::dump(int indent) const
|
||||
case BinaryOp::Slash:
|
||||
op_string = "/";
|
||||
break;
|
||||
case BinaryOp::Modulo:
|
||||
op_string = "%";
|
||||
break;
|
||||
case BinaryOp::TypedEquals:
|
||||
op_string = "===";
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user