1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-01-27 09:55:46 +01:00

Replace expression closures (function expressions).

Expression closures are to be axed. See https://bugzil.la/1083458.
This commit is contained in:
Doug Kearns
2015-05-26 03:38:58 +10:00
parent 34bfc2f50f
commit ce82387cdd
35 changed files with 182 additions and 184 deletions

View File

@@ -299,8 +299,8 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
char = char.toLowerCase();
stack.top.elements.push(update(
function (obj) obj[char] != null ? quote(obj, char)
: "",
obj => obj[char] != null ? quote(obj, char)
: "",
{ test: function test(obj) obj[char] != null }));
for (let elem of stack)
@@ -505,7 +505,7 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
let patterns = [];
let substrings = split(pattern, /((?:[^\\{]|\\.)*)\{((?:[^\\}]|\\.)*)\}/gy,
function (match) {
match => {
patterns.push(split(match[2], /((?:[^\\,]|\\.)*),/gy,
null, ",{}"));
}, "{}");
@@ -972,7 +972,7 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
return iter(obj)
.map(([k, v]) => ["<!ENTITY ", k, " '", String.replace(v == null ? "null" : typeof v == "xml" ? v.toXMLString() : v,
typeof v == "xml" ? /['%]/g : /['"%&<>]/g,
function (m) map[m]),
m => map[m]),
"'>"].join(""))
.join("\n");
},
@@ -1590,8 +1590,8 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
let done = false;
var promise = test,
retVal;
promise.then((arg) => { retVal = arg; done = true; },
(arg) => { retVal = arg; done = true; });
promise.then(arg => { retVal = arg; done = true; },
arg => { retVal = arg; done = true; });
test = () => done;
}