From 238d7c86f4518331cf7563d6baf622401e07a59c Mon Sep 17 00:00:00 2001 From: Phil Crosby Date: Fri, 4 May 2012 23:09:04 -0700 Subject: use proxy instead of self --- lib/utils.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib/utils.js') diff --git a/lib/utils.js b/lib/utils.js index 3a355d7b..d6b7bb93 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -160,7 +160,10 @@ var utils = { }; /* Execute a function with the given value for "this". Equivalent to jQuery.proxy(). */ -Function.prototype.proxy = function(fn, self) { return function() { fn.apply(self, arguments); }; }; +Function.prototype.proxy = function(self) { + var fn = this; + return function() { return fn.apply(self, arguments); }; +}; /* -- cgit v1.2.3