Skip to content

Commit 570d513

Browse files
committed
Walk SwitchCase nodes as separate nodes in the base walker for SwitchStatement
Issue #555
1 parent 12ad116 commit 570d513

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

acorn-walk/src/index.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -207,11 +207,7 @@ base.WithStatement = (node, st, c) => {
207207
}
208208
base.SwitchStatement = (node, st, c) => {
209209
c(node.discriminant, st, "Expression")
210-
for (let cs of node.cases) {
211-
if (cs.test) c(cs.test, st, "Expression")
212-
for (let cons of cs.consequent)
213-
c(cons, st, "Statement")
214-
}
210+
for (let cs of node.cases) c(cs, st)
215211
}
216212
base.SwitchCase = (node, st, c) => {
217213
if (node.test) c(node.test, st, "Expression")

0 commit comments

Comments
 (0)