mirror of
https://github.com/jashkenas/coffeescript.git
synced 2022-11-09 12:23:24 -05:00
merging in the fixed branch for gfxmonk/break_issue
This commit is contained in:
commit
8c2b2c7f80
1 changed files with 17 additions and 0 deletions
|
@ -1,3 +1,4 @@
|
|||
# Test with break at the top level.
|
||||
a: [1,2,3]
|
||||
call_with_lambda: (l) -> null
|
||||
for i in a
|
||||
|
@ -9,3 +10,19 @@ for i in a
|
|||
|
||||
ok a is null
|
||||
|
||||
|
||||
# Test with break *not* at the top level.
|
||||
some_func: (input) ->
|
||||
takes_lambda: (l) -> null
|
||||
for i in [1,2]
|
||||
arbitraty_var: takes_lambda(->)
|
||||
if input == 1
|
||||
return 1
|
||||
else
|
||||
break
|
||||
|
||||
return 2
|
||||
|
||||
ok some_func(1) is 1
|
||||
ok some_func(2) is 2
|
||||
|
||||
|
|
Loading…
Reference in a new issue