Open taralx opened 11 years ago
->
v = ''
-> loop
await f defer v
:+1: same expectation here... have to create an intermediate variable to get around this :( here's even more trivial example
user = null
foo = ->
await foo '...', defer user
Agreed that variables should not be shadowed because of use in defer. Just ran into this as well.
val = 10 do -> console.log val await read defer val
Expect: should write 10. Commenting the await line writes 10.
The code below works as expected.
aval = [10] do -> console.log aval[0] await read defer aval[0]
Input: -> v = '' -> loop await f defer v
Expected result: "var v" only appears at top of function. Actual result: "var v" appears at top of function and inside loop.