1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-02-18 13:15:46 +01:00

Move util.identity to the base module.

Most other functions of its ilk live there.
This commit is contained in:
Doug Kearns
2015-06-11 03:10:16 +10:00
parent 6ca1cc3d08
commit 59613afb27
20 changed files with 49 additions and 46 deletions

View File

@@ -98,6 +98,8 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
haveGecko: deprecated("config.haveGecko", { get: function haveGecko() config.bound.haveGecko }),
OS: deprecated("config.OS", { get: function OS() config.OS }),
identity: deprecated("identity", { get: function identity() global.identity }),
dactyl: update(function dactyl(obj) {
if (obj)
var global = Class.objectGlobal(obj);
@@ -346,7 +348,7 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
return this[this.length - 1];
});
let unknown = util.identity;
let unknown = identity;
if (!keepUnknown)
unknown = () => "";
@@ -395,7 +397,7 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
let [, flags, name] = /^((?:[a-z]-)*)(.*)/.exec(macro);
flags = new RealSet(flags);
let quote = util.identity;
let quote = identity;
if (flags.has("q"))
quote = function quote(obj) {
return typeof obj === "number" ? obj : JSON.stringify(obj);
@@ -851,14 +853,6 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
});
},
/**
* The identity function.
*
* @param {Object} k
* @returns {Object}
*/
identity: function identity(k) k,
/**
* Returns the intersection of two rectangles.
*