mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-01-22 21:28:11 -05:00
use a temp var for range expansion, instead of 'i'
This commit is contained in:
@@ -526,11 +526,12 @@
|
||||
// part of a comprehension, slice, or splice.
|
||||
// TODO: This generates pretty ugly code ... shrink it.
|
||||
compile_array: function compile_array(o) {
|
||||
var arr, body;
|
||||
body = Expressions.wrap([new LiteralNode('i')]);
|
||||
var arr, body, name;
|
||||
name = o.scope.free_variable();
|
||||
body = Expressions.wrap([new LiteralNode(name)]);
|
||||
arr = Expressions.wrap([new ForNode(body, {
|
||||
source: (new ValueNode(this))
|
||||
}, new LiteralNode('i'))
|
||||
}, new LiteralNode(name))
|
||||
]);
|
||||
return (new ParentheticalNode(new CallNode(new CodeNode([], arr)))).compile(o);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user