1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-01-29 14:55:48 +01:00

Fix mode name generated for longer names in mapping serialization. Closes issue #565.

--HG--
extra : rebase_source : 115073fae6cf2a15692cac72df976e1eacf5298e
This commit is contained in:
Kris Maglione
2011-06-11 13:45:30 -04:00
parent c4c0ab7789
commit 3cc9ce2f8c
7 changed files with 40 additions and 16 deletions

View File

@@ -1326,9 +1326,15 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
if (desc.value instanceof Class.Property)
desc = desc.value.init(k) || desc.value;
for (let obj = object; obj && !orig; obj = Object.getPrototypeOf(obj))
if (orig = Object.getOwnPropertyDescriptor(obj, k))
Object.defineProperty(original, k, orig);
if (k in object) {
for (let obj = object; obj && !orig; obj = Object.getPrototypeOf(obj))
if (orig = Object.getOwnPropertyDescriptor(obj, k))
Object.defineProperty(original, k, orig);
if (!orig)
if (orig = Object.getPropertyDescriptor(object, k))
Object.defineProperty(original, k, orig);
}
// Guard against horrible add-ons that use eval-based monkey
// patching.
@@ -1668,7 +1674,7 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
catch (e) {}
let ary = host.split(".");
ary = [ary.slice(i).join(".") for (i in util.range(ary.length - 1, 0, -1))];
ary = [ary.slice(i).join(".") for (i in util.range(ary.length, 0, -1))];
return ary.filter(function (h) h.length >= base.length);
},
@@ -1928,7 +1934,7 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
let res = [], seen = {};
(function rec(frame) {
try {
res = res.concat(util.subdomains(frame.location.host));
res = res.concat(util.subdomains(frame.location.hostname));
}
catch (e) {}
Array.forEach(frame.frames, rec);