From 47645fc976f2020e3b2ddbda3d4b7c69e35cbcd8 Mon Sep 17 00:00:00 2001 From: Linus Groh Date: Tue, 16 Mar 2021 22:03:31 +0100 Subject: [PATCH] LibJS: Ensure SequenceExpression has two or more expressions Just a sanity check, as we should be able to make this assumption elsewhere - this way we can catch silly mistakes early. --- Userland/Libraries/LibJS/AST.h | 1 + 1 file changed, 1 insertion(+) diff --git a/Userland/Libraries/LibJS/AST.h b/Userland/Libraries/LibJS/AST.h index 1c7267ff16..78f9c8dd40 100644 --- a/Userland/Libraries/LibJS/AST.h +++ b/Userland/Libraries/LibJS/AST.h @@ -563,6 +563,7 @@ public: : Expression(move(source_range)) , m_expressions(move(expressions)) { + VERIFY(m_expressions.size() >= 2); } virtual void dump(int indent) const override;