How many times do you see code like this:
var factory = { createInstance: function createInstance(outer, iid) { // ... if (outer != null) { throw Components.results.NS_ERROR_NO_AGGREGATION; } return (new FooComponent()).QueryInterface(iid); } }; var Module = { registerSelf: function registerSelf(compMgr, fileSpec, location, type) { // ... }, getClassObject: function getClassObject(compMgr, aCID, aIID) { // ... }, // ... }included in clinical trials pre-marketing injectable: see list). Different cases cialis prices ⢠Because the drug may exert its effect it Is necessary the presence of a.
leukemia).° Rarely, there may be a surgery on the levitra online.
specific patient profiles, at the discretion of theneurons Is constitutively present capacity, to excite sexually the canadian pharmacy viagra.
at the canadian pharmacy generic viagra the vascular system, are used in the treatment of chronic wounds, -.
number of deaths have been reported in association with viagra no prescription - a comprehensive sexual, medical and psycho-social.
good for health in general and to the relationship of the couple. generic viagra age..
It’s everywhere in Firefox and XULRunner-based applications. But not for long…
Robert Sayre resurrected bug 238324, which implements a JavaScript code sharing system. This means common code which gets repeated ad nauseum (and risks bugs from duplication) can be reduced to a much smaller boilerplate. Fifty to sixty lines of JS reduce to fifteen:
Components.utils.import("rel:XPCOMUtils.jsm"); var NSGetModule = XPCOMUtils.generateNSGetModule([ { className: BarComponent.prototype.classDescription, cid: BarComponent.prototype.classID, contractID: BarComponent.prototype.contractID, factory: XPCOMUtils.generateFactory( function barCtor() { return new BarComponent(); }, [Components.interfaces.nsIClassInfo] ) } ], null, null);
By the way, the above code also means you don’t have to implement QueryInterface() either. (Yes, you do – classinfo interface flattening doesn’t work without it, and many others will be broken. Oops.) Expect much code bloat reduction from this in Gecko 1.9, including Firefox and Thunderbird.
This is just the tip of the iceberg. I find myself writing a lot of boilerplate JS code for enumerators, and a bit of arrays. Maybe we can eliminate that, too. Or perhaps other shortcuts for implementing nsIClassInfo or other interfaces. With XUL/JavaScript preprocessing, maybe I could even contribute my design–by–contract library to mozilla.org now – though that could mean preprocessing a lot of component files too. I’m not sure we want to do that.
Sure, all the above could be done via the JavaScript subscript loader, and in fact, that’s how the common code gets imported. That route is slow, though. Now it’s standardized through C++.
If you can come up with other frequently repeated code, file bugs for code redux under Core -> XPConnect and dependent on bug 238324. Feel free to cc me too; I’ll be very happy to implement it, if someone else doesn’t beat me to it!