jashkenas/coffee-script — Issue #1891: automatic break inside the switch statement
Author: alexwall
Created: 2011-11-24 17:57:15+00:00
State: open

Hi,

coffee-script compiles this

loop
switch step
when 1
console.log "do it and continue with step 2"
when 2
console.log "do it and in some situation skip step 1"
when 3
console.log "do it"

to that

while (true) {
switch (step) {
case 1:
console.log("do it and continue with step 2");
break;
case 2:
console.log("do it and in some situation skip step 1");
break;
case 3:
console.log("do it");
}
}

But I don't want the `break` inside case 1. What can I do?

-Cheers Alex