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