mirror of
https://github.com/jashkenas/coffeescript.git
synced 2022-11-09 12:23:24 -05:00
0247b135f8
In for example `for` loops, a variable called `i` is generated (for the loop index). If that name is unavailable, `j` is used instead, then `k`, `l`, etc. all the way to `z`. Then, `aa`, `ab`, `ac` etc. are used. This meant that, eventually, `do` would be used, but that's not a valid variable name since `do` is a JavaScript keyword. This logic was also inefficiently implemented. For example, going from `aa` to `ab` or from `az` to `ba` required lots of loop iterations. This commit changes the variable naming convention. Now, `i`, `j`, `k`, etc. to `z` are used like before. Then comes `i1`, `j1`, `k1`, etc. Then `i2`, `j2`, `k2` and so on. This is simpler, efficient and easier to understand. `i1` is more obvious to be a loop index than `aa`. Fixes #4267. |
||
---|---|---|
.. | ||
coffee-script |