Permalink
Browse files

Fixes #2155 -- existential assignment to a closure

  • Loading branch information...
1 parent 1c8411f commit b9cfb5a7d85511ca7952f5c13da66f5b8511f7cb @jashkenas jashkenas committed Mar 1, 2012
Showing with 8 additions and 0 deletions.
  1. +1 −0 lib/coffee-script/nodes.js
  2. +1 −0 src/nodes.coffee
  3. +6 −0 test/operators.coffee

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View
@@ -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
@@ -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'

0 comments on commit b9cfb5a

Please sign in to comment.