mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-02-11 16:15:08 -05:00
allowing implicit returns to be pushed down into each branch of computation, even when there's an explicit return nested more deeply. Issue #401
This commit is contained in:
@@ -10,4 +10,15 @@ third: ->
|
||||
|
||||
ok first().join(' ') is 'do do do'
|
||||
ok second()[0].join(' ') is 're re re'
|
||||
ok third().join(' ') is 'mi mi mi'
|
||||
ok third().join(' ') is 'mi mi mi'
|
||||
|
||||
|
||||
# Testing returns with multiple branches.
|
||||
func: ->
|
||||
if false
|
||||
for a in b
|
||||
return c if d
|
||||
else
|
||||
"word"
|
||||
|
||||
ok func() is 'word'
|
||||
Reference in New Issue
Block a user