Fixes #1871, close implicit objects in implicit returns

This commit is contained in:
xixixao
2014-01-23 20:52:26 +00:00
parent b00962db1a
commit 8b976acac1
4 changed files with 21 additions and 3 deletions

View File

@@ -387,6 +387,23 @@ test "#1871: Special case for IMPLICIT_END in the middle of an implicit object",
eq result.two.join(' '), '2 2 2'
test "#1871: implicit object closed by IMPLICIT_END in implicit returns", ->
ob = do ->
a: 1 if no
eq ob, undefined
# instead these return an object
func = ->
key:
i for i in [1, 2, 3]
eq func().key.join(' '), '1 2 3'
func = ->
key: (i for i in [1, 2, 3])
eq func().key.join(' '), '1 2 3'
test "#1961, #1974, regression with compound assigning to an implicit object", ->
obj = null