diff --git a/lib/coffee-script/nodes.js b/lib/coffee-script/nodes.js index 29d4bf80..8e27884b 100644 --- a/lib/coffee-script/nodes.js +++ b/lib/coffee-script/nodes.js @@ -527,8 +527,8 @@ } Call.prototype.children = ['variable', 'args']; Call.prototype.newInstance = function() { - var base; - base = this.variable.base || this.variable; + var base, _ref2; + base = ((_ref2 = this.variable) != null ? _ref2.base : void 0) || this.variable; if (base instanceof Call && !base.isNew) { base.newInstance(); } else { diff --git a/src/nodes.coffee b/src/nodes.coffee index 9d56e1fc..49a7e8fd 100644 --- a/src/nodes.coffee +++ b/src/nodes.coffee @@ -460,7 +460,7 @@ exports.Call = class Call extends Base # Tag this invocation as creating a new instance. newInstance: -> - base = @variable.base or @variable + base = @variable?.base or @variable if base instanceof Call and not base.isNew base.newInstance() else