Fixing issue #902 ... collected comprehension when no comprehension is necessary.

This commit is contained in:
Jeremy Ashkenas
2010-12-09 22:16:32 -05:00
parent ba27b4be69
commit b6324d0007
2 changed files with 4 additions and 4 deletions

View File

@@ -1830,7 +1830,7 @@
body = Expressions.wrap([new If(this.guard, body)]);
}
if (hasCode) {
body = Closure.wrap(body, true);
body = Closure.wrap(body, true, !this.returns);
}
if (namePart) {
varPart = "\n" + idt1 + namePart + ";";
@@ -2061,8 +2061,8 @@
args.push(new Literal('arguments'));
}
func = new Value(func, [new Access(meth)]);
func.noReturn = noReturn;
}
func.noReturn = noReturn;
call = new Call(func, args);
if (statement) {
return Expressions.wrap([call]);

View File

@@ -1461,7 +1461,7 @@ exports.For = class For extends Base
if @guard
body = Expressions.wrap [new If @guard, body]
if hasCode
body = Closure.wrap(body, yes)
body = Closure.wrap(body, yes, not @returns)
varPart = "\n#{idt1}#{namePart};" if namePart
if @object
forPart = "#{ivar} in #{svar}"
@@ -1636,7 +1636,7 @@ Closure =
args = [new Literal 'this']
args.push new Literal 'arguments' if mentionsArgs
func = new Value func, [new Access meth]
func.noReturn = noReturn
func.noReturn = noReturn
call = new Call func, args
if statement then Expressions.wrap [call] else call