mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-02-18 03:21:20 -05:00
Fixed comprehension magic's scoping.
This commit is contained in:
@@ -1724,7 +1724,7 @@
|
||||
if (this.guard) {
|
||||
body = Expressions.wrap([new If(this.guard, body)]);
|
||||
}
|
||||
if (codeInBody) {
|
||||
if (codeInBody && !body.containsPureStatement()) {
|
||||
if (range) {
|
||||
body.unshift(new Literal("var " + name + " = " + ivar));
|
||||
}
|
||||
@@ -1742,7 +1742,8 @@
|
||||
body.push(new Assign(new Literal(nvar), new Literal(name)));
|
||||
}
|
||||
body.push(lastLine);
|
||||
body = Closure.wrap(body, true, true);
|
||||
o.indent = this.idt(1);
|
||||
body = Expressions.wrap([new Literal(body.compile(o))]);
|
||||
if (index) {
|
||||
body.push(new Assign(new Literal(index), new Literal(ivar)));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user