X-Git-Url: https://git.donarmstrong.com/dactyl.git?a=blobdiff_plain;f=common%2Fmodules%2Fservices.jsm;h=315f95189531ef9bd5098dde994faa6693a8967f;hb=354a049cce8415487552ce405cce167b7071fe1f;hp=377cd13edec5345d5e8809a9b35474bcf89c7752;hpb=3d837eb266a3a01d424192aa4ec1a167366178c5;p=dactyl.git diff --git a/common/modules/services.jsm b/common/modules/services.jsm index 377cd13..315f951 100644 --- a/common/modules/services.jsm +++ b/common/modules/services.jsm @@ -111,7 +111,7 @@ var Services = Module("Services", { this.addClass("URL", "@mozilla.org/network/standard-url;1", ["nsIStandardURL", "nsIURL"], "init"); this.addClass("Xmlhttp", "@mozilla.org/xmlextras/xmlhttprequest;1", [], "open"); this.addClass("XPathEvaluator", "@mozilla.org/dom/xpath-evaluator;1", "nsIDOMXPathEvaluator"); - this.addClass("XMLDocument", "@mozilla.org/xml/xml-document;1", ["nsIDOMXMLDocument", "nsIDOMNodeSelector"]); + this.addClass("XMLDocument", "@mozilla.org/xml/xml-document;1", "nsIDOMXMLDocument"); this.addClass("XMLSerializer","@mozilla.org/xmlextras/xmlserializer;1", ["nsIDOMSerializer"]); this.addClass("ZipReader", "@mozilla.org/libjar/zip-reader;1", "nsIZipReader", "open", false); this.addClass("ZipWriter", "@mozilla.org/zipwriter;1", "nsIZipWriter", "open", false); @@ -126,7 +126,8 @@ var Services = Module("Services", { if (!service.interfaces.length) return res.wrappedJSObject || res; - service.interfaces.forEach(function (iface) res instanceof Ci[iface]); + service.interfaces.forEach(iface => { res instanceof Ci[iface]; }); + if (service.init && args.length) { if (service.callable) res[service.init].apply(res, args); @@ -162,7 +163,7 @@ var Services = Module("Services", { this.services[name] = { method: meth, class: class_, interfaces: Array.concat(ifaces || []) }; if (name in this && ifaces && !this.__lookupGetter__(name) && !(this[name] instanceof Ci.nsISupports)) throw TypeError(); - memoize(this, name, function () self._create(name)); + memoize(this, name, () => self._create(name)); }, /** @@ -206,7 +207,7 @@ var Services = Module("Services", { * @param {string} name The service's cache key. */ has: function has(name) Set.has(this.services, name) && this.services[name].class in Cc && - this.services[name].interfaces.every(function (iface) iface in Ci) + this.services[name].interfaces.every(iface => iface in Ci) }); endModule();