Skip to content

Commit

Permalink
Fix scope lookup with optional catch binding
Browse files Browse the repository at this point in the history
Fixes #944.

Signed-off-by: Anders Kaseorg <[email protected]>
  • Loading branch information
andersk committed Oct 14, 2023
1 parent 7979f03 commit 1637a3e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/scope.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,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.
Expand Down

0 comments on commit 1637a3e

Please sign in to comment.