removing arguments-to-array-conversion from coffee

This commit is contained in:
Jeremy Ashkenas
2010-03-15 20:46:14 -07:00
parent 119b80d449
commit 73074daa07
4 changed files with 9 additions and 22 deletions

View File

@@ -167,8 +167,6 @@ exports.Expressions: class Expressions extends BaseNode
# declarations of all inner variables pushed up to the top.
compile_with_declarations: (o) ->
code: @compile_node(o)
args: @contains (node) -> node instanceof ValueNode and node.is_arguments()
code: "${@tab}arguments = Array.prototype.slice.call(arguments, 0);\n$code" if args
code: "${@tab}var ${o.scope.compiled_assignments()};\n$code" if o.scope.has_assignments(this)
code: "${@tab}var ${o.scope.compiled_declarations()};\n$code" if o.scope.has_declarations(this)
code
@@ -266,9 +264,6 @@ exports.ValueNode: class ValueNode extends BaseNode
is_splice: ->
@has_properties() and @properties[@properties.length - 1] instanceof SliceNode
is_arguments: ->
@base.value is 'arguments'
# The value can be unwrapped as its inner node, if there are no attached
# properties.
unwrap: ->