fix(app): fix comment for 'experimental' check
comment stated that when 'experimental' is false, es7 async would be allowed, but that is not the case
This commit is contained in:
parent
9f80296fc4
commit
8a1e4ddb77
1 changed files with 2 additions and 1 deletions
|
@ -101,7 +101,8 @@ app.toJSON = function(){
|
||||||
|
|
||||||
app.use = function(fn){
|
app.use = function(fn){
|
||||||
if (!this.experimental) {
|
if (!this.experimental) {
|
||||||
// es7 async functions are allowed
|
// es7 async functions are not allowed,
|
||||||
|
// so we have to make sure that `fn` is a generator function
|
||||||
assert(fn && 'GeneratorFunction' == fn.constructor.name, 'app.use() requires a generator function');
|
assert(fn && 'GeneratorFunction' == fn.constructor.name, 'app.use() requires a generator function');
|
||||||
}
|
}
|
||||||
debug('use %s', fn._name || fn.name || '-');
|
debug('use %s', fn._name || fn.name || '-');
|
||||||
|
|
Loading…
Reference in a new issue