mirror of
https://github.com/jashkenas/coffeescript.git
synced 2022-11-09 12:23:24 -05:00
20 lines
303 B
CoffeeScript
20 lines
303 B
CoffeeScript
###########
|
|
## Break ##
|
|
###########
|
|
|
|
|
|
test "break at the top level", ->
|
|
for i in [1,2,3]
|
|
result = i
|
|
if i == 2
|
|
break
|
|
eq 2, result
|
|
|
|
test "break *not* at the top level", ->
|
|
someFunc = () ->
|
|
i = 0
|
|
while ++i < 3
|
|
result = i
|
|
break if i > 1
|
|
result
|
|
eq 2, someFunc()
|