slightly optimizing return values of AssignNodes. Issue #539

This commit is contained in:
Jeremy Ashkenas
2010-07-24 12:27:11 -07:00
parent 87226b6f44
commit dc1288d319
7 changed files with 22 additions and 25 deletions

View File

@@ -758,7 +758,10 @@ exports.AssignNode: class AssignNode extends BaseNode
@variable instanceof ValueNode
makeReturn: ->
return new Expressions [this, new ReturnNode(@variable)]
if @isStatement()
return new Expressions [this, new ReturnNode(@variable)]
else
super()
isStatement: ->
@isValue() and (@variable.isArray() or @variable.isObject())