Skip to content

Commit 673da0e

Browse files
authored
fix: fix scope lookup with optional catch binding (#2)
1 parent 0583f73 commit 673da0e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/scope.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ export default function scopePlugin(fork: Fork) {
209209
}
210210
}
211211
if (ScopeType.check(node)) {
212-
if (namedTypes.CatchClause.check(node)) {
212+
if (namedTypes.CatchClause.check(node) && node.param !== null) {
213213
// A catch clause establishes a new scope but the only variable
214214
// bound in that scope is the catch parameter. Any other
215215
// declarations create bindings in the outer scope.

0 commit comments

Comments
 (0)