better indentation for compile_closure

This commit is contained in:
Jeremy Ashkenas
2010-01-10 13:18:44 -05:00
parent 9498ef9fe4
commit 8ea75290b5

View File

@@ -36,8 +36,9 @@ module CoffeeScript
end
def compile_closure(o={})
o[:indent] += idt(1)
"(function() {\n#{compile_node(o.merge(:return => true))}\n#{idt}})()"
indent = o[:indent]
@indent = (o[:indent] = idt(1))
"(function() {\n#{compile_node(o.merge(:return => true))}\n#{indent}})()"
end
# Quick method for the current indentation level, plus tabs out.