coffee-script icon indicating copy to clipboard operation
coffee-script copied to clipboard

iced2 await/defer+ try + continue = wrong execution

Open vird opened this issue 5 years ago • 0 comments

#!/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

vird avatar Aug 21 '20 10:08 vird