summaryrefslogtreecommitdiff
path: root/Libraries/LibJS/AST.cpp
diff options
context:
space:
mode:
authorLinus Groh <mail@linusgroh.de>2020-04-23 13:36:14 +0100
committerAndreas Kling <kling@serenityos.org>2020-04-23 19:38:13 +0200
commitf0e7404480d7712d004fcd9ff6908b6df812b54a (patch)
treeacaae40a1f280ffd62b3ecfb4f2a733424d3df44 /Libraries/LibJS/AST.cpp
parent97366f4dd435c7906ab363d695d85fd7bb56aa96 (diff)
downloadserenity-f0e7404480d7712d004fcd9ff6908b6df812b54a.zip
LibJS: Implement bitwise left shift operator (<<)
Diffstat (limited to 'Libraries/LibJS/AST.cpp')
-rw-r--r--Libraries/LibJS/AST.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/Libraries/LibJS/AST.cpp b/Libraries/LibJS/AST.cpp
index ed8e790df2..2540bdd2fd 100644
--- a/Libraries/LibJS/AST.cpp
+++ b/Libraries/LibJS/AST.cpp
@@ -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);