Add tests for implicit calls with implicit object

This commit is contained in:
Simon Lydell 2015-05-01 11:53:37 +02:00
parent 1e62781759
commit 4e6b6678f7
1 changed files with 21 additions and 0 deletions

View File

@ -674,3 +674,24 @@ test "Non-callable literals shouldn't compile", ->
cantCompile '[2..9](2)'
cantCompile '[1..10][2..9] 2'
cantCompile '[1..10][2..9](2)'
test 'implicit invocation with implicit object literal', ->
f = (obj) -> eq 1, obj.a
f
a: 1
obj =
if f
a: 2
else
a: 1
eq 2, obj.a
f
"a": 1
obj =
if f
"a": 2
else
"a": 1
eq 2, obj.a