From 4f7d314135793bf315304d2663df2144441dc33a Mon Sep 17 00:00:00 2001 From: Phil Crosby Date: Tue, 29 May 2012 16:36:05 -0700 Subject: Have Function.curry take varargs instead of an array. --- lib/utils.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/utils.js b/lib/utils.js index cc68ba8c..ac6f32c3 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -169,7 +169,8 @@ Function.prototype.proxy = function(self) { * This creates a new function out of an existing function, where the new function takes fewer arguments. * This allows us to pass around functions instead of functions + a partial list of arguments. */ -Function.prototype.curry = function(fixedArguments) { +Function.prototype.curry = function() { + var fixedArguments = Array.copy(arguments); var fn = this; return function() { return fn.apply(this, fixedArguments.concat(Array.copy(arguments))); }; }; -- cgit v1.2.3