summaryrefslogtreecommitdiff
path: root/common/modules/config.jsm
diff options
context:
space:
mode:
authorKris Maglione <maglione.k@gmail.com>2011-01-02 19:48:10 -0500
committerKris Maglione <maglione.k@gmail.com>2011-01-02 19:48:10 -0500
commit7605c0ed54b1d56ec9b99d25a9c2ccea42d2108b (patch)
tree988e391a0dd286fa0694a01bc33ea73d336df654 /common/modules/config.jsm
parentc26d3f32185323036283404eb4d72bb04357a8be (diff)
downloadpentadactyl-7605c0ed54b1d56ec9b99d25a9c2ccea42d2108b.tar.gz
Memoize config.browser and config.tabbrowser.
Diffstat (limited to 'common/modules/config.jsm')
-rw-r--r--common/modules/config.jsm5
1 files changed, 3 insertions, 2 deletions
diff --git a/common/modules/config.jsm b/common/modules/config.jsm
index d1ce3ac9..f7e52dff 100644
--- a/common/modules/config.jsm
+++ b/common/modules/config.jsm
@@ -70,8 +70,8 @@ var ConfigBase = Class("ConfigBase", {
util.overlayWindow(window, { append: append.elements() });
},
- get browser() window.gBrowser,
- get tabbrowser() window.gBrowser,
+ browser: Class.memoize(function () window.gBrowser),
+ tabbrowser: Class.memoize(function () window.gBrowser),
get browserModes() [modes.NORMAL],
@@ -522,6 +522,7 @@ config.INIT = update(Object.create(config.INIT), config.INIT, {
// Hmm...
let config1 = Object.create(config);
let config2 = Object.create(config1);
+ config2.instance = config2;
update(config1, config.Local.superapply(config2, arguments));
update(config2, config.Local.apply(config2, arguments));
modules.config = config2;