using @containsType.

This commit is contained in:
Jeremy Ashkenas
2010-09-12 14:44:03 -04:00
parent 3a20d7dacb
commit ea3aa6803a
2 changed files with 20 additions and 28 deletions

View File

@@ -64,7 +64,7 @@ exports.BaseNode = class BaseNode
# by assigning it to a temporary variable.
compileReference: (o, options) ->
options or= {}
pair = if not ((this instanceof CallNode or @contains((n) -> n instanceof CallNode)) or
pair = if not (@containsType(CallNode) or
(this instanceof ValueNode and (not (@base instanceof LiteralNode) or @hasProperties())))
[this, this]
else if this instanceof ValueNode and options.assignment
@@ -369,7 +369,7 @@ exports.ValueNode = class ValueNode extends BaseNode
for prop, i in props
@source = baseline
if prop.soakNode
if @base instanceof CallNode or @base.contains((n) -> n instanceof CallNode) and i is 0
if @base.containsType(CallNode) and i is 0
temp = o.scope.freeVariable()
complete = "(#{ baseline = temp } = (#{complete}))"
complete = if i is 0