Closed joshuas closed 10 years ago
Seems to have been introduced in 14df8993a97fcfd8fb545d548643b041a9309bf1, if the ending value of the splat is an expression it defaults to a negative stride.
Dirty quick fix until this is fixed, make start and end value expressions
for i in [0+0..count-1]
Though still test this, its comparing strings with "0+0" <= "count-1", I think
Hello,
The following example code tries to loop 10 times with an index ranging from 0 to 9, but when compiled with 1.6.3-g it will not execute the loop at all. This is due to a bug which occurs when an await is within the loop and there's a " - 1" in the range (e.g. "for i in [0..count - 1]").
Note that the code below loops fine with ICS and no nested await, and works fine in pure CoffeeScript with the await/defer removed. It isn't a precedence issue with the "-" operator and the 1. Adding parenthesis doesn't fix it.
Translates with 1.4.0c to:
...and translates with 1.6.3-g to:
I'm afraid I do not know in which version this bug was introduced. We were using 1.4.0c and upgraded to 1.6.3-g, so it's somewhere between 'em!