Unified · Split
| @@ -5,15 +5,11 @@ · 4 unmodified lines | |||
| 5 | * DS102: Remove unnecessary code created because of implicit returns | 5 | * DS102: Remove unnecessary code created because of implicit returns |
| 6 | * DS103: Rewrite code to no longer use __guard__, or convert again using --optional-chaining | 6 | * DS103: Rewrite code to no longer use __guard__, or convert again using --optional-chaining |
| 7 | * DS205: Consider reworking code to avoid use of IIFEs | 7 | * DS205: Consider reworking code to avoid use of IIFEs |
| 8 | * DS206: Consider reworking classes to avoid initClass | ||
| 9 | * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md | 8 | * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md |
| 10 | */ | 9 | */ |
| 11 | app.Shortcuts = class Shortcuts { | 10 | app.Shortcuts = class Shortcuts extends Events { |
| 12 | static initClass() { | ||
| 13 | $.extend(this.prototype, Events); | ||
| 14 | } | ||
| 15 | |||
| 16 | constructor() { | 11 | constructor() { |
| 12 | super(); | ||
| 17 | this.onKeydown = this.onKeydown.bind(this); | 13 | this.onKeydown = this.onKeydown.bind(this); |
| 18 | this.onKeypress = this.onKeypress.bind(this); | 14 | this.onKeypress = this.onKeypress.bind(this); |
| 19 | this.isMac = $.isMac(); | 15 | this.isMac = $.isMac(); |
| @@ -306,7 +302,6 @@ app.Shortcuts = class Shortcuts { · 286 unmodified lines | |||
| 306 | } | 302 | } |
| 307 | } | 303 | } |
| 308 | }; | 304 | }; |
| 309 | app.Shortcuts.initClass(); | ||
| 310 | 305 | ||
| 311 | function __guard__(value, transform) { | 306 | function __guard__(value, transform) { |
| 312 | return typeof value !== "undefined" && value !== null | 307 | return typeof value !== "undefined" && value !== null |