Comparing version 1.1.0 to 1.2.0
22
index.js
@@ -77,3 +77,2 @@ 'use strict'; | ||
debug('run'); | ||
var self = this; | ||
var mw = [].concat(this.fns); | ||
@@ -87,4 +86,18 @@ var args = slice.call(arguments); | ||
var fn = co(gen); | ||
var ctx = Object.create(this.context); | ||
ctx.input = args; | ||
var ctx = this.createContext(args, this); | ||
fn.call(ctx, ctx.onerror); | ||
return this; | ||
}; | ||
/** | ||
* Create a context. | ||
* | ||
* @param {Mixed} input | ||
* @return {Object} ctx | ||
* @api private | ||
*/ | ||
w.createContext = function (input, self, ctx) { | ||
ctx = Object.create(this.context); | ||
ctx.input = input; | ||
ctx.output = Object.create(null); | ||
@@ -95,4 +108,3 @@ ctx.onerror = function (err) { | ||
}; | ||
fn.call(ctx, ctx.onerror); | ||
return this; | ||
return ctx; | ||
}; | ||
@@ -99,0 +111,0 @@ |
{ | ||
"name": "co-ware", | ||
"version": "1.1.0", | ||
"version": "1.2.0", | ||
"description": "Ware inspired, easily create your own middleware layer using generators via co.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9665
242