fix corner case in merge_vars (#4289)

fixes #4288
This commit is contained in:
Alex Lam S.L
2020-11-17 20:03:20 +00:00
committed by GitHub
parent 383163afa6
commit caa92aea5d
3 changed files with 48 additions and 8 deletions

View File

@@ -509,10 +509,8 @@ var AST_Lambda = DEFNODE("Lambda", "name argnames length_read uses_arguments", {
},
each_argname: function(visit) {
var tw = new TreeWalker(function(node) {
if (node instanceof AST_DestructuredObject) {
node.properties.forEach(function(prop) {
prop.value.walk(tw);
});
if (node instanceof AST_DestructuredKeyVal) {
node.value.walk(tw);
return true;
}
if (node instanceof AST_SymbolFunarg) visit(node);