1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-20 16:57:59 +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

@@ -447,7 +447,9 @@ var Modes = Module("modes", {
description: Messages.Localized(""),
displayName: Class.Memoize(function () this.name.split("_").map(util.capitalize).join(" ")),
displayName: Class.Memoize(function () {
return this.name.split("_").map(util.capitalize).join(" ");
}),
isinstance: function isinstance(obj)
this.allBases.indexOf(obj) >= 0 || callable(obj) && this instanceof obj,
@@ -468,7 +470,9 @@ var Modes = Module("modes", {
get count() { return !this.insert; },
_display: Class.Memoize(function _display() this.name.replace(/_/g, " ")),
_display: Class.Memoize(function _display() {
return this.name.replace(/_/g, " ");
}),
display: function display() this._display,
@@ -476,15 +480,27 @@ var Modes = Module("modes", {
hidden: false,
input: Class.Memoize(function input() this.insert || this.bases.length && this.bases.some(b => b.input)),
input: Class.Memoize(function input() {
return this.insert || this.bases.length &&
this.bases.some(b => b.input);
}),
insert: Class.Memoize(function insert() this.bases.length && this.bases.some(b => b.insert)),
insert: Class.Memoize(function insert() {
return this.bases.length && this.bases.some(b => b.insert);
}),
ownsFocus: Class.Memoize(function ownsFocus() this.bases.length && this.bases.some(b => b.ownsFocus)),
ownsFocus: Class.Memoize(function ownsFocus() {
return this.bases.length && this.bases.some(b => b.ownsFocus);
}),
passEvent: function passEvent(event) this.input && event.charCode && !(event.ctrlKey || event.altKey || event.metaKey),
passEvent: function passEvent(event) {
return this.input && event.charCode &&
!(event.ctrlKey || event.altKey || event.metaKey);
},
passUnknown: Class.Memoize(function () options.get("passunknown").getKey(this.name)),
passUnknown: Class.Memoize(function () {
return options.get("passunknown").getKey(this.name);
}),
get mask() { return this; },
@@ -505,7 +521,9 @@ var Modes = Module("modes", {
StackElement: (function () {
const StackElement = Struct("main", "extended", "params", "saved");
StackElement.className = "Modes.StackElement";
StackElement.defaultValue("params", function () this.main.params);
StackElement.defaultValue("params", function () {
return this.main.params;
});
update(StackElement.prototype, {
get toStringParams() {