Skip to content

Commit

Permalink
Walk SwitchCase nodes as separate nodes in the base walker for Switch…
Browse files Browse the repository at this point in the history
…Statement

Issue #555
  • Loading branch information
marijnh committed Sep 8, 2024
1 parent 12ad116 commit 570d513
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions acorn-walk/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -207,11 +207,7 @@ base.WithStatement = (node, st, c) => {
}
base.SwitchStatement = (node, st, c) => {
c(node.discriminant, st, "Expression")
for (let cs of node.cases) {
if (cs.test) c(cs.test, st, "Expression")
for (let cons of cs.consequent)
c(cons, st, "Statement")
}
for (let cs of node.cases) c(cs, st)
}
base.SwitchCase = (node, st, c) => {
if (node.test) c(node.test, st, "Expression")
Expand Down

0 comments on commit 570d513

Please sign in to comment.