Fix: Collect variables declare in switch-case.(fixes #1453)

Stylistic:

```
} else if (...) {
```