mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 15:38:10 +00:00
LibJS: Add basic support for modulo (%) in binary expressions
This commit is contained in:
parent
9c8363bb5f
commit
644ff1bbfd
6 changed files with 25 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue