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

LibJS: Move logical not operator to new unary expression class

This commit is contained in:
0xtechnobabble 2020-03-09 19:04:44 +02:00 committed by Andreas Kling
parent 65343388b8
commit 5e817ee678
2 changed files with 7 additions and 22 deletions

View file

@ -209,7 +209,6 @@ private:
enum class LogicalOp {
And,
Or,
Not
};
class LogicalExpression : public Expression {
@ -221,13 +220,6 @@ public:
{
}
LogicalExpression(LogicalOp op, NonnullOwnPtr<Expression> lhs)
: m_op(op)
, m_lhs(move(lhs))
{
ASSERT(op == LogicalOp::Not);
}
virtual Value execute(Interpreter&) const override;
virtual void dump(int indent) const override;
@ -236,11 +228,12 @@ private:
LogicalOp m_op;
NonnullOwnPtr<Expression> m_lhs;
OwnPtr<Expression> m_rhs;
NonnullOwnPtr<Expression> m_rhs;
};
enum class UnaryOp {
BitNot,
Not,
};
class UnaryExpression : public Expression {