//
// This work is licensed for reuse under an MIT license. Details are
// given in the LICENSE.txt file included with this file.
-"use strict";
+/* use strict */
try {
var JSMLoader = BOOTSTRAP_CONTRACT in Components.classes &&
Components.classes[BOOTSTRAP_CONTRACT].getService().wrappedJSObject.loader;
-if (!JSMLoader && "@mozilla.org/fuel/application;1" in Components.classes)
- JSMLoader = Components.classes["@mozilla.org/fuel/application;1"]
- .getService(Components.interfaces.extIApplication)
- .storage.get("dactyl.JSMLoader", null);
-
-if (JSMLoader && JSMLoader.bump === 5)
+if (JSMLoader && JSMLoader.bump === 6)
JSMLoader.global = this;
else
JSMLoader = {
- bump: 5,
+ bump: 6,
builtin: Cu.Sandbox(this),
factories: [],
+ name: "dactyl",
+
global: this,
globals: JSMLoader ? JSMLoader.globals : {},
purge: function purge() {
dump("dactyl: JSMLoader: purge\n");
+ this.bootstrap = null;
+
if (Cu.unload) {
Object.keys(this.modules).reverse().forEach(function (url) {
try {
}
},
+ Factory: function Factory(clas) ({
+ __proto__: clas.prototype,
+
+ createInstance: function (outer, iid) {
+ try {
+ if (outer != null)
+ throw Cr.NS_ERROR_NO_AGGREGATION;
+ if (!clas.instance)
+ clas.instance = new clas();
+ return clas.instance.QueryInterface(iid);
+ }
+ catch (e) {
+ Cu.reportError(e);
+ throw e;
+ }
+ }
+ }),
+
registerFactory: function registerFactory(factory) {
this.manager.registerFactory(factory.classID,
String(factory.classID),