removing no_paren -- it was optimizing away order of operations

This commit is contained in:
Jeremy Ashkenas 2009-12-26 11:55:34 -08:00
parent 08dddb27a0
commit 694833dbd0
1 changed files with 3 additions and 3 deletions

View File

@ -207,7 +207,7 @@ module CoffeeScript
def compile(o={})
o = super(o)
args = @arguments.map{|a| a.compile(o.merge(:no_paren => true)) }.join(', ')
args = @arguments.map{|a| a.compile(o) }.join(', ')
return write(compile_super(args, o)) if super?
prefix = @new ? "new " : ''
write("#{prefix}#{@variable.compile(o)}(#{args})")
@ -511,7 +511,7 @@ module CoffeeScript
o = super(o)
o.delete(:return)
indent = o[:indent] + TAB
cond = @condition.compile(o.merge(:no_paren => true))
cond = @condition.compile(o)
write("while (#{cond}) {\n#{@body.compile(o.merge(:indent => indent))}\n#{o[:indent]}}")
end
end
@ -656,7 +656,7 @@ module CoffeeScript
o = super(o)
compiled = @expressions.compile(o)
compiled = compiled[0...-1] if compiled[-1..-1] == ';'
write(o[:no_paren] ? compiled : "(#{compiled})")
write("(#{compiled})")
end
end