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/completion.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'lib/completion.js') diff --git a/lib/completion.js b/lib/completion.js index 7e4bcf57..14c2dbe4 100644 --- a/lib/completion.js +++ b/lib/completion.js @@ -50,8 +50,7 @@ var completion = (function() { }, filter: function(query, callback) { - var self = this; - var handler = function(results) { callback(self.processResults(query, results)); } + var handler = function(results) { callback(this.processResults(query, results)); }.proxy(this); // are the results ready? if (this.completions !== null) { @@ -61,9 +60,9 @@ var completion = (function() { // no: register the handler as a callback this.resultsReady = function(results) { handler(results); - self.resultsReady = self.fallbackReadyCallback; - self.resultsReady(results); - } + this.resultsReady = this.fallbackReadyCallback; + this.resultsReady(results); + }.proxy(this); } } }); -- cgit v1.2.3