For the next major I think we should consider removing the autogenerated methods from here:
|
// create Router#VERB functions |
|
methods.concat('all').forEach(function (method) { |
|
Router.prototype[method] = function (path) { |
|
const route = this.route(path) |
|
route[method].apply(route, slice.call(arguments, 1)) |
|
return this |
|
} |
|
}) |
.
We can provide the main ones statically, and instead rely on a new router.method("METHOD", ...) for the obscure ones. The main reason is to avoid confusion arounds methods such as BIND, which overwrote the JavaScript .bind property, which created a number of bug reports in Express 4.
For the next major I think we should consider removing the autogenerated methods from here:
router/index.js
Lines 436 to 443 in 36ae18f
We can provide the main ones statically, and instead rely on a new
router.method("METHOD", ...)for the obscure ones. The main reason is to avoid confusion arounds methods such asBIND, which overwrote the JavaScript.bindproperty, which created a number of bug reports in Express 4.