1
Fork 0
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:
Linus Groh 2020-04-05 13:40:00 +01:00 committed by Andreas Kling
parent eafd3dbaf8
commit 0403845d3e
7 changed files with 48 additions and 1 deletions

View file

@ -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;