mirror of
https://github.com/jashkenas/coffeescript.git
synced 2022-11-09 12:23:24 -05:00
Adding a comprehension/jump test.
This commit is contained in:
parent
0a48f613ec
commit
a2f9f9320b
1 changed files with 10 additions and 1 deletions
|
@ -269,4 +269,13 @@ for y in [1, 2, 3] ->
|
|||
z = y
|
||||
funcs.push -> "y is #{y} and z is #{z}"
|
||||
|
||||
eq funcs[1](), "y is 2 and z is 2"
|
||||
eq funcs[1](), "y is 2 and z is 2"
|
||||
|
||||
|
||||
# Cancel the comprehension if there's a jump inside the loop.
|
||||
result = try
|
||||
for i in [0...10]
|
||||
continue if i < 5
|
||||
i
|
||||
|
||||
eq result, 10
|
||||
|
|
Loading…
Reference in a new issue