added a nice --watch mode to continually recompile or relint (or reprint) your coffeescripts

This commit is contained in:
Jeremy Ashkenas
2009-12-17 20:37:39 -05:00
parent 9249ceaef5
commit 398251ff90
2 changed files with 35 additions and 10 deletions

View File

@@ -76,6 +76,7 @@ class ReturnNode < Node
end
def compile(indent, scope, opts={})
return @expression.compile(indent, scope, opts.merge(:return => true)) if @expression.custom_return?
compiled = @expression.compile(indent, scope)
@expression.statement? ? "#{compiled}\n#{indent}return null" : "return #{compiled}"
end