making the each fixture a little more like underscore, and avoiding passing assignment into functions from the outside

This commit is contained in:
Jeremy Ashkenas
2009-12-19 00:45:36 -05:00
parent 0b2e7f1e59
commit 9ba1ffde21
4 changed files with 18 additions and 16 deletions

View File

@@ -338,7 +338,8 @@ module CoffeeScript
def compile(indent, scope, opts={})
scope = Scope.new(scope)
@params.each {|id| scope.find(id.to_s) }
opts = opts.merge(:return => true)
opts[:return] = true
opts.delete(:assign)
code = @body.compile(indent + TAB, scope, opts)
write("function(#{@params.join(', ')}) {\n#{code}\n#{indent}}")
end