rzimmerman / kal

A powerful, easy-to-use, and easy-to-read programming language for the future.
http://rzimmerman.github.io/kal
MIT License
394 stars 18 forks source link

Issues with sequential try/catch blocks #94

Closed rzimmerman closed 11 years ago

rzimmerman commented 11 years ago

The following test:

  it 'should work without return values', (done) -> # gh-85
    d = 0
    task side_effect(a,b,c)
      d = a + b + c
    function errorizor(next)
      next "ERR"
    wait for side_effect 1, 2, 3
    d.should.equal 6
    error_happened = no
    try
      wait for errorizor()
    catch e
      error_happened = yes
      e.should.equal "ERR"
    error_happened.should.be.true
    try
      safe wait for errorizor()
    catch e
      require('should').fail 'did not expect an error'
    d.should.equal 6
    done()

Produced a call to a non existent $kcb function in the second try block.