1
0
Fork 0
mirror of https://github.com/jashkenas/coffeescript.git synced 2022-11-09 12:23:24 -05:00

subtle call order bug was preventing variable declarations

This commit is contained in:
Jeremy Ashkenas 2010-01-03 18:22:10 -05:00
parent 3724778989
commit 56015bd23f

View file

@ -122,9 +122,10 @@ module CoffeeScript
end
def compile_with_declarations(o={})
code = compile_node(o)
decls = ''
decls = "#{o[:indent]}var #{o[:scope].declared_variables.join(', ')};\n" if o[:scope].declarations?(self)
code = decls + compile_node(o)
decls + code
end
end