1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 11:18:11 +00:00

LibJS: Implement bitwise right shift operator (>>)

This commit is contained in:
Linus Groh 2020-04-23 13:45:19 +01:00 committed by Andreas Kling
parent f0e7404480
commit 502d1f5165
5 changed files with 88 additions and 1 deletions

View file

@ -755,6 +755,12 @@ Value AssignmentExpression::execute(Interpreter& interpreter) const
return {};
rhs_result = left_shift(interpreter, lhs_result, rhs_result);
break;
case AssignmentOp::RightShiftAssignment:
lhs_result = m_lhs->execute(interpreter);
if (interpreter.exception())
return {};
rhs_result = right_shift(interpreter, lhs_result, rhs_result);
break;
}
if (interpreter.exception())
return {};
@ -825,6 +831,9 @@ void AssignmentExpression::dump(int indent) const
case AssignmentOp::LeftShiftAssignment:
op_string = "<<=";
break;
case AssignmentOp::RightShiftAssignment:
op_string = ">>=";
break;
}
ASTNode::dump(indent);