Closed
Bug 581307
Opened 14 years ago
Closed 14 years ago
XPCOMUtils should provide a convenient way to lazily import modules
Categories
(Core :: XPCOM, enhancement)
Core
XPCOM
Tracking
()
RESOLVED
FIXED
mozilla5
People
(Reporter: neil, Assigned: neil)
References
Details
(Keywords: dev-doc-complete)
Attachments
(1 file)
(deleted),
patch
|
sayrer
:
review+
|
Details | Diff | Splinter Review |
Seeing as we're doing everything lazily these days, why not centalise the code to import modules lazily. This would replace ugly boilerplate code like this:
get _manager () {
var temp = {};
Cu.import("resource://gre/modules/LightweightThemeManager.jsm", temp);
delete this._manager;
return this._manager = temp.LightweightThemeManager;
},
with a simple
XPCOMUtils.defineLazyModuleImporter(LightWeightThemeWebInstaller, "_manager", "resource://gre/modules/LightweightThemeManager.jsm", "LightweightThemeManager");
Assignee | ||
Comment 1•14 years ago
|
||
Comment 2•14 years ago
|
||
Comment on attachment 459762 [details] [diff] [review]
Proposed patch
Looks fine, assuming we get coverage on this in short order.
Attachment #459762 -
Flags: review?(sayrer) → review+
Comment 3•14 years ago
|
||
Flags: in-testsuite-
Whiteboard: fixed-in-cedar
Comment 4•14 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
No longer depends on: post2.0
Resolution: --- → FIXED
Whiteboard: fixed-in-cedar
Target Milestone: --- → mozilla2.2
Comment 5•13 years ago
|
||
Added to the documentation: https://developer.mozilla.org/en/JavaScript_code_modules/XPCOMUtils.jsm#defineLazyModuleGetter%28%29
Keywords: dev-doc-complete
You need to log in
before you can comment on or make changes to this bug.
Description
•