stop assigning to arguments object in _.compose

This commit is contained in:
Jeremy Ashkenas
2009-12-06 12:35:11 -05:00
parent 8ca9739dfe
commit 79cb7bb17b

View File

@@ -379,10 +379,11 @@
_.compose = function() {
var funcs = _.toArray(arguments);
return function() {
var args = _.toArray(arguments);
for (var i=funcs.length-1; i >= 0; i--) {
arguments = [funcs[i].apply(this, arguments)];
args = [funcs[i].apply(this, args)];
}
return arguments[0];
return args[0];
};
};