diff options
author | Kris Maglione <maglione.k@gmail.com> | 2011-01-02 19:48:10 -0500 |
---|---|---|
committer | Kris Maglione <maglione.k@gmail.com> | 2011-01-02 19:48:10 -0500 |
commit | 7605c0ed54b1d56ec9b99d25a9c2ccea42d2108b (patch) | |
tree | 988e391a0dd286fa0694a01bc33ea73d336df654 /common/modules/config.jsm | |
parent | c26d3f32185323036283404eb4d72bb04357a8be (diff) | |
download | pentadactyl-7605c0ed54b1d56ec9b99d25a9c2ccea42d2108b.tar.gz |
Memoize config.browser and config.tabbrowser.
Diffstat (limited to 'common/modules/config.jsm')
-rw-r--r-- | common/modules/config.jsm | 5 |
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; |