Skip to content

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

@vird

Description

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions