mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 12:48:10 +00:00
LibJS: Implement modulo assignment operator (%=)
This commit is contained in:
parent
a2e1f1a872
commit
72d2bd56ce
4 changed files with 18 additions and 0 deletions
|
@ -850,6 +850,12 @@ Value AssignmentExpression::execute(Interpreter& interpreter) const
|
|||
return {};
|
||||
rhs_result = div(interpreter, lhs_result, rhs_result);
|
||||
break;
|
||||
case AssignmentOp::ModuloAssignment:
|
||||
lhs_result = m_lhs->execute(interpreter);
|
||||
if (interpreter.exception())
|
||||
return {};
|
||||
rhs_result = mod(interpreter, lhs_result, rhs_result);
|
||||
break;
|
||||
case AssignmentOp::ExponentiationAssignment:
|
||||
lhs_result = m_lhs->execute(interpreter);
|
||||
if (interpreter.exception())
|
||||
|
@ -960,6 +966,9 @@ void AssignmentExpression::dump(int indent) const
|
|||
case AssignmentOp::DivisionAssignment:
|
||||
op_string = "/=";
|
||||
break;
|
||||
case AssignmentOp::ModuloAssignment:
|
||||
op_string = "%=";
|
||||
break;
|
||||
case AssignmentOp::ExponentiationAssignment:
|
||||
op_string = "**=";
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue