From 5d60ea3234e61f05d3e76f394bfea7390ff3e31f Mon Sep 17 00:00:00 2001 From: Pionxzh Date: Thu, 18 Jul 2024 20:51:50 +0800 Subject: [PATCH] fix: fix scope lookup with optional catch binding --- src/scope.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/scope.ts b/src/scope.ts index e97d567b..5e4c6df4 100644 --- a/src/scope.ts +++ b/src/scope.ts @@ -209,7 +209,7 @@ export default function scopePlugin(fork: Fork) { } } if (ScopeType.check(node)) { - if (namedTypes.CatchClause.check(node)) { + if (namedTypes.CatchClause.check(node) && node.param !== null) { // A catch clause establishes a new scope but the only variable // bound in that scope is the catch parameter. Any other // declarations create bindings in the outer scope.