maxtaco / coffee-script

IcedCoffeeScript
http://maxtaco.github.com/coffee-script
MIT License
726 stars 58 forks source link

Issue with await in switch statement #55

Closed boris-petrov closed 11 years ago

boris-petrov commented 11 years ago

The following code:

foo = (callback) ->
  do callback

console.log 1

switch 'asd'
  when 'foo'
    await foo defer()
  when 'bar'
    x = 1

console.log 2

Outputs only "1" while it should output a "2" too. If you put a:

  when 'asd'
    x = 2

In the switch, then it works fine. But if none of the cases are matched, then Iced "blocks".

maxtaco commented 11 years ago

I'll check it out, this does look like a bug. Thanks.

maxtaco commented 11 years ago

Closed, thanks for the bug report!