removing the 'var' declaration from arguments-to-array conversions

This commit is contained in:
Jeremy Ashkenas
2010-02-21 16:15:01 -05:00
parent 6e15a4da0e
commit dbe5328c33
2 changed files with 3 additions and 5 deletions

View File

@@ -156,8 +156,7 @@ Expressions: exports.Expressions: inherit Node, {
compile_with_declarations: (o) ->
code: @compile_node(o)
args: @contains (node) -> node instanceof ValueNode and node.is_arguments()
argv: if args and o.scope.check('arguments') then '' else 'var '
code: @idt() + argv + "arguments = Array.prototype.slice.call(arguments, 0);\n" + code if args
code: @idt() + "arguments = Array.prototype.slice.call(arguments, 0);\n" + code if args
code: @idt() + 'var ' + o.scope.compiled_assignments() + ";\n" + code if o.scope.has_assignments(this)
code: @idt() + 'var ' + o.scope.compiled_declarations() + ";\n" + code if o.scope.has_declarations(this)
code