mirror of
https://github.com/RGBCube/serenity
synced 2025-05-24 01:15:07 +00:00
LibJS: Implement bitwise left shift operator (<<)
This commit is contained in:
parent
97366f4dd4
commit
f0e7404480
7 changed files with 95 additions and 1 deletions
|
@ -749,6 +749,12 @@ Value AssignmentExpression::execute(Interpreter& interpreter) const
|
|||
return {};
|
||||
rhs_result = div(interpreter, lhs_result, rhs_result);
|
||||
break;
|
||||
case AssignmentOp::LeftShiftAssignment:
|
||||
lhs_result = m_lhs->execute(interpreter);
|
||||
if (interpreter.exception())
|
||||
return {};
|
||||
rhs_result = left_shift(interpreter, lhs_result, rhs_result);
|
||||
break;
|
||||
}
|
||||
if (interpreter.exception())
|
||||
return {};
|
||||
|
@ -816,6 +822,9 @@ void AssignmentExpression::dump(int indent) const
|
|||
case AssignmentOp::DivisionAssignment:
|
||||
op_string = "/=";
|
||||
break;
|
||||
case AssignmentOp::LeftShiftAssignment:
|
||||
op_string = "<<=";
|
||||
break;
|
||||
}
|
||||
|
||||
ASTNode::dump(indent);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue