Skip to content

Commit

Permalink
No param in CatchClause should not crash
Browse files Browse the repository at this point in the history
  • Loading branch information
othree committed Sep 6, 2019
1 parent 9ddff4c commit 556f555
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/infer.js
Original file line number Diff line number Diff line change
Expand Up @@ -1134,6 +1134,7 @@
walk.base.BlockStatement(node, scope, c);
},
CatchClause: function(node, scope, c) {
if (!node.param) { return; }
scope = node.scope = new Scope(scope, node, false, true);
if (node.param.type == "Identifier") {
var v = addVar(scope, node.param);
Expand Down

0 comments on commit 556f555

Please sign in to comment.