mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-02-18 19:34:27 -05:00
use a temp var for range expansion, instead of 'i'
This commit is contained in:
@@ -450,8 +450,9 @@ RangeNode: exports.RangeNode: inherit Node, {
|
||||
# part of a comprehension, slice, or splice.
|
||||
# TODO: This generates pretty ugly code ... shrink it.
|
||||
compile_array: (o) ->
|
||||
body: Expressions.wrap([new LiteralNode('i')])
|
||||
arr: Expressions.wrap([new ForNode(body, {source: (new ValueNode(this))}, new LiteralNode('i'))])
|
||||
name: o.scope.free_variable()
|
||||
body: Expressions.wrap([new LiteralNode(name)])
|
||||
arr: Expressions.wrap([new ForNode(body, {source: (new ValueNode(this))}, new LiteralNode(name))])
|
||||
(new ParentheticalNode(new CallNode(new CodeNode([], arr)))).compile(o)
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user