improve AST validation (#3864)

This commit is contained in:
Alex Lam S.L
2020-05-09 22:25:44 +01:00
committed by GitHub
parent f74b7f7401
commit 97728c4f0b
4 changed files with 18 additions and 7 deletions

View File

@@ -784,6 +784,7 @@ var AST_Sequence = DEFNODE("Sequence", "expressions", {
});
},
_validate: function() {
if (this.expressions.length < 2) throw new Error("expressions must contain multiple elements");
must_be_expressions(this, "expressions");
},
});