mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-02 23:56:06 +00:00
LibJS: Move logical not operator to new unary expression class
This commit is contained in:
parent
65343388b8
commit
5e817ee678
Notes:
sideshowbarker
2024-07-19 08:48:53 +09:00
Author: https://github.com/0xtechnobabble
Commit: 5e817ee678
Pull-request: https://github.com/SerenityOS/serenity/pull/1397
Reviewed-by: https://github.com/sunverwerth
2 changed files with 7 additions and 22 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue