maxtaco / coffee-script

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

iced2 await/defer+ try + continue = wrong execution #207

Open vird opened 4 years ago

vird commented 4 years ago
#!/usr/bin/env iced
console.log "HERE"
for i in [0 ... 10]
  console.log "ok", i
  await setTimeout defer(), 10 # comment this line and all fixed
  try
    a = 1
    console.log "OK"
  catch err
    console.log "WTF"
    continue
  console.log "fail", i
console.log "THERE"

expected

HERE
ok 0
OK
fail 0
ok 1
OK
fail 1
ok 2
OK
fail 2
ok 3
OK
fail 3
ok 4
OK
fail 4
ok 5
OK
fail 5
ok 6
OK
fail 6
ok 7
OK
fail 7
ok 8
OK
fail 8
ok 9
OK
fail 9
THERE

real

HERE
ok 0
OK

iced -v \ IcedCoffeeScript version 108.0.13