mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-05-03 03:00:14 -04:00
some cleanup, renaming temporary variable from _by to _step
This commit is contained in:
@@ -408,23 +408,23 @@ test "issue #1124: don't assign a variable in two scopes", ->
|
||||
listb = (_i + 1 for _i in lista)
|
||||
arrayEq [2, 3, 4, 5, 6], listb
|
||||
|
||||
test "Issue #1326. `by` value is uncached", ->
|
||||
test "#1326: `by` value is uncached", ->
|
||||
a = [0,1,2]
|
||||
fi = gi = hi = 0
|
||||
f = -> ++fi
|
||||
g = -> ++gi
|
||||
h = -> ++hi
|
||||
|
||||
|
||||
forCompile = []
|
||||
rangeCompileSimple = []
|
||||
|
||||
|
||||
#exercises For.compile
|
||||
for v,i in a by f() then forCompile.push i
|
||||
|
||||
|
||||
#exercises Range.compileSimple
|
||||
rangeCompileSimple = (i for i in [0..2] by g())
|
||||
|
||||
arrayEq a, forCompile
|
||||
arrayEq a, rangeCompileSimple
|
||||
#exercises Range.compile
|
||||
eq "#{i for i in [0..2] by h()}", '0,1,2'
|
||||
eq "#{i for i in [0..2] by h()}", '0,1,2'
|
||||
|
||||
Reference in New Issue
Block a user