1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-24 02:22:26 +01:00

Replace expression closures (function expressions - named and dynamic this).

Expression closures are to be axed. See https://bugzil.la/1083458.

Leaving deprecated() and literal() calls and method shorthand syntax
conversions until after the ESR overlap.
This commit is contained in:
Doug Kearns
2015-06-06 23:12:40 +10:00
parent 07b64b3197
commit b236add69d
43 changed files with 876 additions and 520 deletions

View File

@@ -65,12 +65,16 @@ var History = Module("history", {
let obj = [];
obj.__defineGetter__("index", () => sh.index);
obj.__defineSetter__("index", val => { webNav.gotoIndex(val); });
obj[Symbol.iterator] = function () this.entries();
obj[Symbol.iterator] = function () { return this.entries(); };
for (let item of iter(sh.SHistoryEnumerator, Ci.nsISHEntry))
obj.push(update(Object.create(item), {
index: obj.length,
icon: Class.Memoize(function () services.favicon.getFaviconImageForPage(this.URI).spec)
icon: Class.Memoize(function () {
return services.favicon
.getFaviconImageForPage(this.URI)
.spec;
})
}));
return obj;
},
@@ -348,7 +352,9 @@ var History = Module("history", {
if (maxItems && context.maxItems == null)
context.maxItems = 100;
context.regenerate = true;
context.generate = function () history.get(context.filter, this.maxItems, sort);
context.generate = function () {
return history.get(context.filter, this.maxItems, sort);
};
};
completion.addUrlCompleter("history", "History", completion.history);