diff options
author | Kris Maglione <maglione.k@gmail.com> | 2013-08-21 22:55:55 -0700 |
---|---|---|
committer | Kris Maglione <maglione.k@gmail.com> | 2013-08-21 22:55:55 -0700 |
commit | c89f3e0df5cfd776acf4843351948453a1719ce2 (patch) | |
tree | 88da92b93138e2e40c74438643a8c4d25b1f80d3 /common/modules/services.jsm | |
parent | e5864bfd235e805fa0af301a41dc88f61e8c3006 (diff) | |
download | pentadactyl-c89f3e0df5cfd776acf4843351948453a1719ce2.tar.gz |
Hello strange new syntax. Can we be friends?
Diffstat (limited to 'common/modules/services.jsm')
-rw-r--r-- | common/modules/services.jsm | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/common/modules/services.jsm b/common/modules/services.jsm index b67e8dad..377cd13e 100644 --- a/common/modules/services.jsm +++ b/common/modules/services.jsm @@ -1,4 +1,4 @@ -// Copyright (c) 2008-2012 Kris Maglione <maglione.k at Gmail> +// Copyright (c) 2008-2013 Kris Maglione <maglione.k at Gmail> // // This work is licensed for reuse under an MIT license. Details are // given in the LICENSE.txt file included with this file. @@ -139,7 +139,7 @@ var Services = Module("Services", { if (service.quiet === false) throw e.stack ? e : Error(e); - if (typeof util !== "undefined") + if (typeof util !== "undefined" && util != null) util.reportError(e); else dump("dactyl: Service creation failed for '" + service.class + "': " + e + "\n" + (e.stack || Error(e).stack)); @@ -176,13 +176,12 @@ var Services = Module("Services", { * class. */ addClass: function addClass(name, class_, ifaces, init, quiet) { - const self = this; this.services[name] = { class: class_, interfaces: Array.concat(ifaces || []), method: "createInstance", init: init, quiet: quiet }; if (init) memoize(this.services[name], "callable", function () callable(XPCOMShim(this.interfaces)[this.init])); - this[name] = function Create() self._create(name, arguments); + this[name] = (function Create() this._create(name, arguments)).bind(this); update.apply(null, [this[name]].concat([Ci[i] for each (i in Array.concat(ifaces))])); return this[name]; }, |