upgrade co@4

master
dead_horse 2014-11-17 21:21:00 +08:00
parent 193eadbdb5
commit 3f183a196b
2 changed files with 3 additions and 3 deletions

View File

@ -113,7 +113,7 @@ app.use = function(fn){
app.callback = function(){
var mw = [respond].concat(this.middleware);
var gen = compose(mw);
var fn = co(gen);
var fn = co.wrap(gen);
var self = this;
if (!this.listeners('error').length) this.on('error', this.onerror);
@ -122,7 +122,7 @@ app.callback = function(){
res.statusCode = 404;
var ctx = self.createContext(req, res);
onFinished(res, ctx.onerror);
fn.call(ctx, ctx.onerror);
fn.call(ctx).catch(ctx.onerror);
}
};

View File

@ -19,7 +19,7 @@
"license": "MIT",
"dependencies": {
"accepts": "^1.1.0",
"co": "^3.1.0",
"co": "^4.0.0",
"content-disposition": "~0.5.0",
"cookies": "~0.5.0",
"debug": "*",