mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-02-18 11:31:20 -05:00
removing no_paren -- it was optimizing away order of operations
This commit is contained in:
@@ -207,7 +207,7 @@ module CoffeeScript
|
|||||||
|
|
||||||
def compile(o={})
|
def compile(o={})
|
||||||
o = super(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?
|
return write(compile_super(args, o)) if super?
|
||||||
prefix = @new ? "new " : ''
|
prefix = @new ? "new " : ''
|
||||||
write("#{prefix}#{@variable.compile(o)}(#{args})")
|
write("#{prefix}#{@variable.compile(o)}(#{args})")
|
||||||
@@ -511,7 +511,7 @@ module CoffeeScript
|
|||||||
o = super(o)
|
o = super(o)
|
||||||
o.delete(:return)
|
o.delete(:return)
|
||||||
indent = o[:indent] + TAB
|
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]}}")
|
write("while (#{cond}) {\n#{@body.compile(o.merge(:indent => indent))}\n#{o[:indent]}}")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -656,7 +656,7 @@ module CoffeeScript
|
|||||||
o = super(o)
|
o = super(o)
|
||||||
compiled = @expressions.compile(o)
|
compiled = @expressions.compile(o)
|
||||||
compiled = compiled[0...-1] if compiled[-1..-1] == ';'
|
compiled = compiled[0...-1] if compiled[-1..-1] == ';'
|
||||||
write(o[:no_paren] ? compiled : "(#{compiled})")
|
write("(#{compiled})")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user