debug: check for fn._name as well

This commit is contained in:
Jonathan Ong 2013-12-29 16:04:06 -08:00
parent ebed2a34af
commit 51da356a5f

View file

@ -80,7 +80,7 @@ app.listen = function(){
app.use = function(fn){ app.use = function(fn){
assert('GeneratorFunction' == fn.constructor.name, 'app.use() requires a generator function'); assert('GeneratorFunction' == fn.constructor.name, 'app.use() requires a generator function');
debug('use %s', fn.name || '-'); debug('use %s', fn._name || fn.name || '-');
this.middleware.push(fn); this.middleware.push(fn);
return this; return this;
}; };