From 0aba8fb619cf9e0bcef71c6a864cac27e1fcc53b Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Sun, 20 Dec 2015 14:07:52 -0800 Subject: [PATCH] Fix some issues with loading from an XPI. --- common/modules/config.jsm | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/common/modules/config.jsm b/common/modules/config.jsm index c73cd0e5..d9bfb88c 100644 --- a/common/modules/config.jsm +++ b/common/modules/config.jsm @@ -117,9 +117,11 @@ var ConfigBase = Class("ConfigBase", { if (isArray(value)) value = Set(value); - this[prop] = update({}, this[prop], - iter([util.camelCase(k), value[k]] - for (k in value)).toObject()); + let overrides = {}; + for (let [key, val] of Object.entries(value)) + overrides[util.camelCase(key)] = val; + + this[prop] = update({}, this[prop], overrides); } else this[prop] = value; @@ -239,7 +241,7 @@ var ConfigBase = Class("ConfigBase", { if (jar) { let prefix = getDir(jar.JAREntry); res = Array.from(io.listJar(jar.JARFile, prefix), - s => slice(prefix.length).replace(/\/.*/, "")); + s => s.slice(prefix.length).replace(/\/.*/, "")); } else { res = Array.from(util.getFile(uri).readDirectory()) @@ -433,10 +435,15 @@ var ConfigBase = Class("ConfigBase", { get fileExt() { return this.name.slice(0, -6); }, dtd: Class.Memoize(function () { - return iter(this.dtdExtra, - (["dactyl." + k, v] for ([k, v] of iter(config.dtdDactyl))), - (["dactyl." + s, config[s]] for (s of config.dtdStrings))) - .toObject(); + return Ary.toObject([ + ...Object.entries(this.dtdExtra), + + ...Object.entries(config.dtdDactyl) + .map(([k, v]) => ["dactyl." + k, v]), + + ...config.dtdStrings + .map(str => ["dactyl." + str, config[str]]), + ]); }), dtdDactyl: memoize({