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:
Jeremy Ashkenas
2010-06-13 01:13:52 -04:00
parent 88ea66b4c9
commit 5612a59b30
3 changed files with 29 additions and 12 deletions

View File

@@ -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'