1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-20 09:48:00 +01:00

Add favicons to :ba and :fo

This commit is contained in:
Kris Maglione
2009-07-21 14:48:30 -04:00
parent 773814c985
commit a7de8b8cd0
4 changed files with 28 additions and 4 deletions

View File

@@ -178,6 +178,25 @@ const util = { //{{{
return dest;
},
/**
* Memoize the lookup of a property in an object.
*
* @param {object} obj The object to alter.
* @param {string} key The name of the property to memoize.
* @param {function} getter A function of zero to two arguments which
* will return the property's value. <b>obj</b> is
* passed as the first argument, <b>key</b> as the
* second.
*/
memoize: function memoize(obj, key, getter)
{
obj.__defineGetter__(key, function() {
delete obj[key]
obj[key] = getter(obj, key);
return obj[key];
});
},
/**
* Split a string on literal occurrences of a marker.
*