From d761e429f7c6b8583d32f7849fdbeb9aa2b50faf Mon Sep 17 00:00:00 2001 From: Niklas Baumstark Date: Wed, 25 Jan 2012 01:22:19 +0100 Subject: introduce a utils helper for prototype inheritance --- lib/completion.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/completion.js') diff --git a/lib/completion.js b/lib/completion.js index 6aec9e83..3c43f28b 100644 --- a/lib/completion.js +++ b/lib/completion.js @@ -410,7 +410,7 @@ var completion = (function() { AsyncFuzzyUrlCompleter.call(this); this.maxResults = maxResults || 1000; } - FuzzyHistoryCompleter.prototype = new AsyncFuzzyUrlCompleter; + utils.extend(AsyncFuzzyUrlCompleter, FuzzyHistoryCompleter); FuzzyHistoryCompleter.prototype.refresh = function() { this.resetCache(); this.fetchFromPort('getHistory', { maxResults: this.maxResults }, function(msg) { @@ -424,7 +424,7 @@ var completion = (function() { var FuzzyBookmarkCompleter = function() { AsyncFuzzyUrlCompleter.call(this); } - FuzzyBookmarkCompleter.prototype = new AsyncFuzzyUrlCompleter; + utils.extend(AsyncFuzzyUrlCompleter, FuzzyBookmarkCompleter); FuzzyBookmarkCompleter.prototype.refresh = function() { this.resetCache(); this.fetchFromPort('getAllBookmarks', {}, function(msg) { @@ -439,7 +439,7 @@ var completion = (function() { var FuzzyTabCompleter = function() { AsyncFuzzyUrlCompleter.call(this); } - FuzzyTabCompleter.prototype = new AsyncFuzzyUrlCompleter; + utils.extend(AsyncFuzzyUrlCompleter, FuzzyTabCompleter); FuzzyTabCompleter.prototype.createAction = function(match) { var open = function() { chrome.extension.sendRequest({ handler: 'selectSpecificTab', id: match.tab.id }); -- cgit v1.2.3