mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-05-03 03:00:14 -04:00
Fixing issue #902 ... collected comprehension when no comprehension is necessary.
This commit is contained in:
@@ -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]);
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user