fix corner case in conditionals (#5547)

fixes #5546
This commit is contained in:
Alex Lam S.L
2022-07-07 08:49:33 +01:00
committed by GitHub
parent 3dcf098468
commit 902292f776
2 changed files with 112 additions and 0 deletions

View File

@@ -1185,6 +1185,11 @@ var AST_Try = DEFNODE("Try", "bcatch bfinally", {
bcatch: "[AST_Catch?] the catch block, or null if not present",
bfinally: "[AST_Finally?] the finally block, or null if not present"
},
_equals: function(node) {
return all_equals(this.body, node.body)
&& prop_equals(this.bcatch, node.bcatch)
&& prop_equals(this.bfinally, node.bfinally);
},
walk: function(visitor) {
var node = this;
visitor.visit(node, function() {