Unified · Split
| @@ -9,10 +9,8 @@ · 8 unmodified lines | ||
| 9 | 9 | * DS207: Consider shorter variations of null checks |
| 10 | 10 | * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md |
| 11 | 11 | */ |
| 12 | −app.Router = class Router { | |
| 12 | +app.Router = class Router extends Events { | |
| 13 | 13 | static initClass() { |
| 14 | − $.extend(this.prototype, Events); | |
| 15 | − | |
| 16 | 14 | this.routes = [ |
| 17 | 15 | ["*", "before"], |
| 18 | 16 | ["/", "root"], |
| @@ -29,6 +27,7 @@ app.Router = class Router { · 10 unmodified lines | ||
| 29 | 27 | } |
| 30 | 28 | |
| 31 | 29 | constructor() { |
| 30 | + super(); | |
| 32 | 31 | for (var [path, method] of Array.from(this.constructor.routes)) { |
| 33 | 32 | page(path, this[method].bind(this)); |
| 34 | 33 | } |