separating out the --no-wrap and the --globals arguments, which shouldn't be jammed together

This commit is contained in:
Jeremy Ashkenas
2010-01-07 21:10:25 -05:00
parent 30dca132bd
commit d416c184db
5 changed files with 29 additions and 24 deletions

View File

@@ -127,7 +127,7 @@ module CoffeeScript
indent = o[:no_wrap] ? '' : TAB
@indent = indent
o.merge!(:indent => indent, :scope => Scope.new(nil, self))
code = o[:no_wrap] ? compile_node(o) : compile_with_declarations(o)
code = o[:globals] ? compile_node(o) : compile_with_declarations(o)
code.gsub!(STRIP_TRAILING_WHITESPACE, '')
o[:no_wrap] ? code : "(function(){\n#{code}\n})();"
end
@@ -499,6 +499,7 @@ module CoffeeScript
o[:top] = true
o[:indent] = idt(1)
o.delete(:no_wrap)
o.delete(:globals)
name = o.delete(:immediate_assign)
if @params.last.is_a?(ParamSplatNode)
splat = @params.pop