fix corner case with destructuring catch (#4426)

fixes #4425
This commit is contained in:
Alex Lam S.L
2020-12-20 02:31:32 +00:00
committed by GitHub
parent b7c49b72b3
commit f5224ca1f5
2 changed files with 39 additions and 1 deletions

View File

@@ -255,7 +255,9 @@ AST_Toplevel.DEFMETHOD("figure_out_scope", function(options) {
i = in_arg.lastIndexOf(sym.scope, i - 1);
if (i < 0) break;
var decl = sym.orig[0];
if (decl instanceof AST_SymbolFunarg || decl instanceof AST_SymbolLambda) {
if (decl instanceof AST_SymbolCatch
|| decl instanceof AST_SymbolFunarg
|| decl instanceof AST_SymbolLambda) {
node.in_arg = true;
break;
}