aboutsummaryrefslogtreecommitdiffstats
path: root/lib/utils.js
diff options
context:
space:
mode:
authorPhil Crosby2012-05-29 16:36:05 -0700
committerPhil Crosby2012-05-29 16:36:05 -0700
commit4f7d314135793bf315304d2663df2144441dc33a (patch)
treed8a18d854f20e475bebadfa854186741524c2b72 /lib/utils.js
parentaf17e5c0fc703ab31f855859f429158cde666131 (diff)
downloadvimium-4f7d314135793bf315304d2663df2144441dc33a.tar.bz2
Have Function.curry take varargs instead of an array.
Diffstat (limited to 'lib/utils.js')
-rw-r--r--lib/utils.js3
1 files changed, 2 insertions, 1 deletions
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))); };
};