mirror of
https://github.com/RGBCube/serenity
synced 2025-07-24 22:17:42 +00:00
LibJS: Implement exponentiation (** operator)
This commit is contained in:
parent
eafd3dbaf8
commit
0403845d3e
7 changed files with 48 additions and 1 deletions
|
@ -283,6 +283,8 @@ Value BinaryExpression::execute(Interpreter& interpreter) const
|
|||
return div(lhs_result, rhs_result);
|
||||
case BinaryOp::Modulo:
|
||||
return mod(lhs_result, rhs_result);
|
||||
case BinaryOp::Exponentiation:
|
||||
return exp(lhs_result, rhs_result);
|
||||
case BinaryOp::TypedEquals:
|
||||
return typed_eq(lhs_result, rhs_result);
|
||||
case BinaryOp::TypedInequals:
|
||||
|
@ -421,6 +423,9 @@ void BinaryExpression::dump(int indent) const
|
|||
case BinaryOp::Modulo:
|
||||
op_string = "%";
|
||||
break;
|
||||
case BinaryOp::Exponentiation:
|
||||
op_string = "**";
|
||||
break;
|
||||
case BinaryOp::TypedEquals:
|
||||
op_string = "===";
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue