mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-05 16:14:38 +00:00
LibJS: Implement multiplication and division operators
This commit is contained in:
committed by
Andreas Kling
parent
9f3f0d9983
commit
fdf7f81ba9
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user