diff --git a/lib/coffee-script/nodes.js b/lib/coffee-script/nodes.js index 8ff9b99c04..15d397209c 100644 --- a/lib/coffee-script/nodes.js +++ b/lib/coffee-script/nodes.js @@ -1566,6 +1566,7 @@ o.scope.shared = del(o, 'sharedScope'); o.indent += TAB; delete o.bare; + delete o.isExistentialEquals; params = []; exprs = []; _ref3 = this.paramNames(); diff --git a/src/nodes.coffee b/src/nodes.coffee index 6aee1e96f4..e90ba72886 100644 --- a/src/nodes.coffee +++ b/src/nodes.coffee @@ -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 diff --git a/test/operators.coffee b/test/operators.coffee index 2ae0c6a90f..b539cccbe0 100644 --- a/test/operators.coffee +++ b/test/operators.coffee @@ -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' \ No newline at end of file