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:
parent
f0e7404480
commit
502d1f5165
5 changed files with 88 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue