1
0
Fork 0
mirror of https://github.com/jashkenas/coffeescript.git synced 2022-11-09 12:23:24 -05:00

Fixes #2155 -- existential assignment to a closure

This commit is contained in:
Jeremy Ashkenas 2012-02-29 23:41:57 -05:00
parent 1c8411f628
commit b9cfb5a7d8
3 changed files with 8 additions and 0 deletions

View file

@ -1566,6 +1566,7 @@
o.scope.shared = del(o, 'sharedScope');
o.indent += TAB;
delete o.bare;
delete o.isExistentialEquals;
params = [];
exprs = [];
_ref3 = this.paramNames();

View file

@ -1171,6 +1171,7 @@ exports.Code = class Code extends Base
o.scope.shared = del(o, 'sharedScope')
o.indent += TAB
delete o.bare
delete o.isExistentialEquals
params = []
exprs = []
for name in @paramNames() # this step must be performed before the others

View file

@ -269,3 +269,9 @@ test "Regression with implicit calls against an indented assignment", ->
1
eq a, 1
test "#2155 ... conditional assignment to a closure", ->
x = null
func = -> x ?= (-> if true then 'hi')
func()
eq x(), 'hi'