mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-02-18 11:31:20 -05:00
fixing existential chains directly against a 'new Func()' call. Issue #503
This commit is contained in:
@@ -62,8 +62,8 @@ exports.BaseNode: class BaseNode
|
||||
# in multiple places, ensure that the expression is only ever evaluated once,
|
||||
# by assigning it to a temporary variable.
|
||||
compileReference: (o, options) ->
|
||||
pair: if not (this instanceof CallNode or this instanceof ValueNode and
|
||||
(not (@base instanceof LiteralNode) or @hasProperties()))
|
||||
pair: if not ((this instanceof CallNode or @contains((n) -> n instanceof CallNode)) or
|
||||
(this instanceof ValueNode and (not (@base instanceof LiteralNode) or @hasProperties())))
|
||||
[this, this]
|
||||
else
|
||||
reference: literal o.scope.freeVariable()
|
||||
@@ -356,7 +356,7 @@ exports.ValueNode: class ValueNode extends BaseNode
|
||||
for prop, i in props
|
||||
@source: baseline
|
||||
if prop.soakNode
|
||||
if @base instanceof CallNode and i is 0
|
||||
if @base instanceof CallNode or @base.contains((n) -> n instanceof CallNode) and i is 0
|
||||
temp: o.scope.freeVariable()
|
||||
complete: "(${ baseline: temp } = ($complete))"
|
||||
complete: "typeof $complete === \"undefined\" || $baseline" if i is 0 and @isStart(o)
|
||||
|
||||
Reference in New Issue
Block a user