1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-21 15:27:57 +01:00

Some esthetic and practical changes to modes and a couple of completion functions.

This commit is contained in:
Kris Maglione
2009-05-05 17:23:04 -04:00
parent f83a99ba06
commit 43537025c6
6 changed files with 76 additions and 35 deletions

View File

@@ -160,6 +160,24 @@ const util = { //{{{
return delimiter + str.replace(/([\\'"])/g, "\\$1").replace("\n", "\\n", "g").replace("\t", "\\t", "g") + delimiter;
},
extend: function extend(dest) {
Array.slice(arguments, 1).filter(util.identity).forEach(function (src)
{
for (let [k, v] in Iterator(src))
{
let get = src.__lookupGetter__(k),
set = src.__lookupSetter__(k);
if (!get && !set)
dest[k] = v;
if (get)
dest.__defineGetter__(k, get);
if (set)
dest.__defineSetter__(k, set);
}
});
return dest;
},
/**
* Split a string on literal occurances of a marker.
*