mirror of
https://github.com/jashkenas/coffeescript.git
synced 2022-11-09 12:23:24 -05:00
fixing doubled semis
This commit is contained in:
parent
0c6ee52cfc
commit
b72641693d
2 changed files with 5 additions and 2 deletions
|
@ -512,6 +512,7 @@
|
|||
};
|
||||
__extends(CurryNode, CallNode);
|
||||
CurryNode.prototype.type = 'Curry';
|
||||
CurryNode.prototype.body = 'func.apply(obj, args.concat(Array.prototype.slice.call(arguments, 0)))';
|
||||
CurryNode.prototype.arguments = function arguments(o) {
|
||||
var _a, _b, _c, arg;
|
||||
_a = this.args;
|
||||
|
@ -525,7 +526,7 @@
|
|||
};
|
||||
CurryNode.prototype.compile_node = function compile_node(o) {
|
||||
var body, curried, curry;
|
||||
body = Expressions.wrap([literal('func.apply(obj, args.concat(Array.prototype.slice.call(arguments, 0)));')]);
|
||||
body = Expressions.wrap([literal(this.body)]);
|
||||
curried = new CodeNode([], body);
|
||||
curry = new CodeNode([literal('func'), literal('obj'), literal('args')], Expressions.wrap([curried]));
|
||||
return (new ParentheticalNode(new CallNode(curry, [this.meth, this.context, literal(this.arguments(o))]))).compile(o);
|
||||
|
|
|
@ -394,6 +394,8 @@ exports.CallNode: class CallNode extends BaseNode
|
|||
exports.CurryNode: class CurryNode extends CallNode
|
||||
type: 'Curry'
|
||||
|
||||
body: 'func.apply(obj, args.concat(Array.prototype.slice.call(arguments, 0)))'
|
||||
|
||||
constructor: (meth, args) ->
|
||||
@children: flatten [@meth: meth, @context: args[0], @args: (args.slice(1) or [])]
|
||||
|
||||
|
@ -403,7 +405,7 @@ exports.CurryNode: class CurryNode extends CallNode
|
|||
(new ArrayNode(@args)).compile o
|
||||
|
||||
compile_node: (o) ->
|
||||
body: Expressions.wrap([literal('func.apply(obj, args.concat(Array.prototype.slice.call(arguments, 0)));')])
|
||||
body: Expressions.wrap([literal @body])
|
||||
curried: new CodeNode([], body)
|
||||
curry: new CodeNode([literal('func'), literal('obj'), literal('args')], Expressions.wrap([curried]))
|
||||
(new ParentheticalNode(new CallNode(curry, [@meth, @context, literal(@arguments(o))]))).compile o
|
||||
|
|
Loading…
Add table
Reference in a new issue