aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2020-12-20 02:31:32 +0000
committerGitHub <noreply@github.com>2020-12-20 10:31:32 +0800
commitf5224ca1f5075d6912616675f1aa7fa8cc7741f1 (patch)
tree26b0bad890f3aea870631608c708bf9269dc8265 /lib
parentb7c49b72b3abd5da869d882a4e122cb155382874 (diff)
downloadtracifyjs-f5224ca1f5075d6912616675f1aa7fa8cc7741f1.tar.gz
tracifyjs-f5224ca1f5075d6912616675f1aa7fa8cc7741f1.zip
fix corner case with destructuring `catch` (#4426)
fixes #4425
Diffstat (limited to 'lib')
-rw-r--r--lib/scope.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/scope.js b/lib/scope.js
index 779637cb..c59dc0a7 100644
--- a/lib/scope.js
+++ b/lib/scope.js
@@ -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;
}