Merge branch 'bugfix-1108' of https://github.com/thejh/coffee-script into thejh-bugfix-1108

This commit is contained in:
Michael Ficarra
2011-03-27 23:54:46 -04:00
3 changed files with 14 additions and 8 deletions

View File

@@ -1301,12 +1301,12 @@ exports.Op = class Op extends Base
compileExistence: (o) ->
if @first.isComplex()
ref = o.scope.freeVariable 'ref'
fst = new Parens new Assign new Literal(ref), @first
ref = new Literal o.scope.freeVariable 'ref'
fst = new Parens new Assign ref, @first
else
fst = @first
ref = fst.compile o
new Existence(fst).compile(o) + " ? #{ref} : #{ @second.compile o, LEVEL_LIST }"
ref = fst
new If(new Existence(fst), ref, type: 'if').addElse(@second).compile o
# Compile a unary **Op**.
compileUnary: (o) ->