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

Replace expression closures (methods).

Expression closures are to be axed. See https://bugzil.la/1083458.
This commit is contained in:
Doug Kearns
2015-07-23 01:55:32 +10:00
parent c035aa936b
commit 77d59cdfd1
45 changed files with 1595 additions and 1045 deletions

View File

@@ -76,7 +76,9 @@ var Download = Class("Download", {
get status() { return states[this.state]; },
inState: function inState(states) states.indexOf(this.status) >= 0,
inState: function inState(states) {
return states.indexOf(this.status) >= 0;
},
allowedCommands: Class.Memoize(function () {
let self = this;
@@ -161,11 +163,12 @@ var Download = Class("Download", {
url: (a, b) => String.localeCompare(a.source.url, b.source.url)
},
compare: function compare(other) values(this.list.sortOrder).map(function (order) {
let val = this._compare[order.substr(1)](this, other);
return (order[0] == "-") ? -val : val;
}, this).find(identity) || 0,
compare: function compare(other) {
return values(this.list.sortOrder).map(function (order) {
let val = this._compare[order.substr(1)](this, other);
return (order[0] == "-") ? -val : val;
}, this).find(identity) || 0;
},
timeRemaining: Infinity,
@@ -344,7 +347,9 @@ var DownloadList = Class("DownloadList",
this.nodes.list.childNodes[i + 1]);
},
shouldSort: function shouldSort() Array.some(arguments, val => this.sortOrder.some(v => v.substr(1) == val)),
shouldSort: function shouldSort() {
return Array.some(arguments, val => this.sortOrder.some(v => v.substr(1) == val));
},
update: function update() {
for (let node of values(this.nodes))
@@ -427,8 +432,8 @@ var DownloadList = Class("DownloadList",
"tryToKeepPartialData"].forEach(key => {
if (!(key in Download.prototype))
Object.defineProperty(Download.prototype, key, {
get: function get() this.download[key],
set: function set(val) this.download[key] = val,
get: function get() { return this.download[key]; },
set: function set(val) { this.download[key] = val; },
configurable: true
});
});