mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 04:38:11 +00:00
LibJS: Implement multiplication and division operators
This commit is contained in:
parent
9f3f0d9983
commit
fdf7f81ba9
5 changed files with 34 additions and 1 deletions
|
@ -115,6 +115,10 @@ Value BinaryExpression::execute(Interpreter& interpreter) const
|
|||
return add(lhs_result, rhs_result);
|
||||
case BinaryOp::Minus:
|
||||
return sub(lhs_result, rhs_result);
|
||||
case BinaryOp::Asterisk:
|
||||
return mul(lhs_result, rhs_result);
|
||||
case BinaryOp::Slash:
|
||||
return div(lhs_result, rhs_result);
|
||||
case BinaryOp::TypedEquals:
|
||||
return typed_eq(lhs_result, rhs_result);
|
||||
case BinaryOp::TypedInequals:
|
||||
|
@ -194,6 +198,12 @@ void BinaryExpression::dump(int indent) const
|
|||
case BinaryOp::Minus:
|
||||
op_string = "-";
|
||||
break;
|
||||
case BinaryOp::Asterisk:
|
||||
op_string = "*";
|
||||
break;
|
||||
case BinaryOp::Slash:
|
||||
op_string = "/";
|
||||
break;
|
||||
case BinaryOp::TypedEquals:
|
||||
op_string = "===";
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue