mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-04-11 03:00:13 -04:00
self-compiling closures as expressions
This commit is contained in:
@@ -729,7 +729,7 @@
|
||||
wrap: function wrap(expressions, statement) {
|
||||
var call, func;
|
||||
func = new ParentheticalNode(new CodeNode([], Expressions.wrap([expressions])));
|
||||
call = new CallNode(new ValueNode(func, new AccessorNode(new LiteralNode('call'))), [new LiteralNode('this')]);
|
||||
call = new CallNode(new ValueNode(func, [new AccessorNode(new LiteralNode('call'))]), [new LiteralNode('this')]);
|
||||
return statement ? Expressions.wrap([call]) : call;
|
||||
}
|
||||
});
|
||||
@@ -1216,7 +1216,7 @@
|
||||
this.condition = condition;
|
||||
this.body = body && body.unwrap();
|
||||
this.else_body = else_body && else_body.unwrap();
|
||||
this.children = [this.condition, this.body, this.else_body];
|
||||
this.children = compact([this.condition, this.body, this.else_body]);
|
||||
this.tags = tags || {
|
||||
};
|
||||
if (this.condition instanceof Array) {
|
||||
|
||||
Reference in New Issue
Block a user