From d2ee91b604cb1dce18f55f8b5ab99c325322487c Mon Sep 17 00:00:00 2001 From: saneyuki_s Date: Thu, 3 Jan 2013 09:07:55 +0900 Subject: [PATCH] Use Function.bind() instead of 'self'. --- modules/window.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/modules/window.js b/modules/window.js index 202fcc0e..64f6730c 100644 --- a/modules/window.js +++ b/modules/window.js @@ -384,16 +384,15 @@ TreeStyleTabWindow.prototype = { initUninstallationListener : function TSTWindow_initUninstallationListener() { - var self = this; var restorePrefs = function() { if (prefs.getPref('extensions.treestyletab.tabsOnTop.originalState')) { prefs.clearPref('extensions.treestyletab.tabsOnTop.originalState'); try { - self.browser.treeStyleTab.position = 'top'; + this.browser.treeStyleTab.position = 'top'; } catch(e) { } - self.window.TabsOnTop.enabled = true; + this.window.TabsOnTop.enabled = true; } let restorePrefs = [ @@ -413,7 +412,7 @@ TreeStyleTabWindow.prototype = { // clear backup pref. prefs.clearPref(pref+'.backup'); } - }; + }.bind(this); new this.window['piro.sakura.ne.jp'].UninstallationListener({ id : 'treestyletab@piro.sakura.ne.jp', onuninstalled : restorePrefs,