Unified · Split
| @@ -9,7 +9,7 @@ · 8 unmodified lines | ||
| 9 | 9 | * DS208: Avoid top-level this |
| 10 | 10 | * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md |
| 11 | 11 | */ |
| 12 | −this.Events = { | |
| 12 | +class Events { | |
| 13 | 13 | on(event, callback) { |
| 14 | 14 | if (event.indexOf(" ") >= 0) { |
| 15 | 15 | for (var name of Array.from(event.split(" "))) { |
| @@ -26,7 +26,7 @@ this.Events = { · 10 unmodified lines | ||
| 26 | 26 | ).push(callback); |
| 27 | 27 | } |
| 28 | 28 | return this; |
| 29 | − }, | |
| 29 | + } | |
| 30 | 30 | |
| 31 | 31 | off(event, callback) { |
| 32 | 32 | let callbacks, index; |
| @@ -45,7 +45,7 @@ this.Events = { · 12 unmodified lines | ||
| 45 | 45 | } |
| 46 | 46 | } |
| 47 | 47 | return this; |
| 48 | − }, | |
| 48 | + } | |
| 49 | 49 | |
| 50 | 50 | trigger(event, ...args) { |
| 51 | 51 | let callbacks; |
| @@ -64,7 +64,7 @@ this.Events = { · 12 unmodified lines | ||
| 64 | 64 | this.trigger("all", event, ...Array.from(args)); |
| 65 | 65 | } |
| 66 | 66 | return this; |
| 67 | − }, | |
| 67 | + } | |
| 68 | 68 | |
| 69 | 69 | removeEvent(event) { |
| 70 | 70 | if (this._callbacks != null) { |
| @@ -73,5 +73,5 @@ this.Events = { · 2 unmodified lines | ||
| 73 | 73 | } |
| 74 | 74 | } |
| 75 | 75 | return this; |
| 76 | − }, | |
| 77 | −}; | |
| 76 | + } | |
| 77 | +} | |