Ensure middleware functions are named #5366
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pretty boring PR is the result of me looking to refactor various bits of the frontend. I've been playing around with our middleware stack and looking for ways to test and see how it behaves with different changes. To do this, it's much easier if all of the middleware functions are named.
Where I've touched a file, I've named all of the anonymous functions in that file. I have looked to enable this jscs rule: http://jscs.info/rule/disallowAnonymousFunctions.html, but there are thousands of anonymous functions in the codebase, so that's a pretty long job. Long term I think it is worthwhile, as it will aid with other tasks like debugging & optimising memory usage.
If you're interested, this is what I've been using to print out the middleware stack and take a look at it: https://gist.github.com/ErisDS/2fec0b64f28a945cb8d4
refs #5091