mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-01-04 05:24:12 +01:00
Replace expression closures (methods).
Expression closures are to be axed. See https://bugzil.la/1083458.
This commit is contained in:
@@ -39,7 +39,9 @@ var Abbreviation = Class("Abbreviation", {
|
||||
* @param {Abbreviation} other The abbreviation to test.
|
||||
* @returns {boolean} The result of the comparison.
|
||||
*/
|
||||
equals: function (other) this.lhs == other.lhs && this.rhs == other.rhs,
|
||||
equals: function (other) {
|
||||
return this.lhs == other.lhs && this.rhs == other.rhs;
|
||||
},
|
||||
|
||||
/**
|
||||
* Returns the abbreviation's expansion text.
|
||||
@@ -48,7 +50,9 @@ var Abbreviation = Class("Abbreviation", {
|
||||
* occurring.
|
||||
* @returns {string}
|
||||
*/
|
||||
expand: function (editor) String(callable(this.rhs) ? this.rhs(editor) : this.rhs),
|
||||
expand: function (editor) {
|
||||
return String(callable(this.rhs) ? this.rhs(editor) : this.rhs);
|
||||
},
|
||||
|
||||
/**
|
||||
* Returns true if this abbreviation is defined for all *modes*.
|
||||
@@ -56,7 +60,9 @@ var Abbreviation = Class("Abbreviation", {
|
||||
* @param {[Mode]} modes The modes to test.
|
||||
* @returns {boolean} The result of the comparison.
|
||||
*/
|
||||
modesEqual: function (modes) Ary.equals(this.modes, modes),
|
||||
modesEqual: function (modes) {
|
||||
return Ary.equals(this.modes, modes);
|
||||
},
|
||||
|
||||
/**
|
||||
* Returns true if this abbreviation is defined for *mode*.
|
||||
@@ -64,7 +70,9 @@ var Abbreviation = Class("Abbreviation", {
|
||||
* @param {Mode} mode The mode to test.
|
||||
* @returns {boolean} The result of the comparison.
|
||||
*/
|
||||
inMode: function (mode) this.modes.some(m => m == mode),
|
||||
inMode: function (mode) {
|
||||
return this.modes.some(m => m == mode);
|
||||
},
|
||||
|
||||
/**
|
||||
* Returns true if this abbreviation is defined in any of *modes*.
|
||||
@@ -72,7 +80,9 @@ var Abbreviation = Class("Abbreviation", {
|
||||
* @param {[Modes]} modes The modes to test.
|
||||
* @returns {boolean} The result of the comparison.
|
||||
*/
|
||||
inModes: function (modes) modes.some(mode => this.inMode(mode)),
|
||||
inModes: function (modes) {
|
||||
return modes.some(mode => this.inMode(mode));
|
||||
},
|
||||
|
||||
/**
|
||||
* Remove *mode* from the list of supported modes for this abbreviation.
|
||||
|
||||
Reference in New Issue
Block a user