mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-05-03 03:00:14 -04:00
Fixes #1871, close implicit objects in implicit returns
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user