self-compiling closures as expressions

This commit is contained in:
Jeremy Ashkenas
2010-02-12 14:26:01 -05:00
parent 61a7f7a567
commit 156a0b13d9
2 changed files with 4 additions and 4 deletions

View File

@@ -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) {