jaredhanson/passport — pull request #110 by 1602 (2013-03-05 07:12:41+00:00)
Title: Expose middleware name

This code is fully equivalent, with one difference useful for debugging: when I do console.log(app.stack) I will see something like:

```
[ { route: '', handle: [Function: query] },
{ route: '', handle: [Function: expressInit] },
{ route: '', handle: [Function: assetsCompiler] },
{ route: '', handle: [Function: static] },
{ route: '', handle: [Function: bodyParser] },
{ route: '', handle: [Function: cookieParser] },
{ route: '', handle: [Function: session] },
{ route: '', handle: [Function: methodOverride] },
{ route: '', handle: [Function: passportInit] },
{ route: '', handle: [Function: passportAuth] },
{ route: '', handle: [Function: router] },
{ route: '', handle: [Function: errorHandler] } ]
```

instead of

```
[ { route: '', handle: [Function: query] },
{ route: '', handle: [Function: expressInit] },
{ route: '', handle: [Function: assetsCompiler] },
{ route: '', handle: [Function: static] },
{ route: '', handle: [Function: bodyParser] },
{ route: '', handle: [Function: cookieParser] },
{ route: '', handle: [Function: session] },
{ route: '', handle: [Function: methodOverride] },
{ route: '', handle: [Function] },
{ route: '', handle: [Function] },
{ route: '', handle: [Function: router] },
{ route: '', handle: [Function: errorHandler] } ]
```

And second reason: code without binds works a little bit faster; not much, but this "optimization" may be useful in that case, because it's middleware.