Comparing version 4.3.1 to 4.4.0
4.4.0 / 2014-02-14 | ||
================== | ||
* refactor `isGeneratorFunction` | ||
* expose generator function from `co.wrap()` | ||
* drop support for node < 0.12 | ||
4.3.0 / 2014-02-05 | ||
@@ -3,0 +10,0 @@ ================== |
17
index.js
@@ -27,5 +27,7 @@ | ||
co.wrap = function (fn) { | ||
return function () { | ||
createPromise.__generatorFunction__ = fn; | ||
return createPromise; | ||
function createPromise() { | ||
return co.call(this, fn.apply(this, arguments)); | ||
}; | ||
} | ||
}; | ||
@@ -38,3 +40,3 @@ | ||
* @param {Function} fn | ||
* @return {Function} | ||
* @return {Promise} | ||
* @api public | ||
@@ -218,8 +220,5 @@ */ | ||
var constructor = obj.constructor; | ||
var proto = constructor.prototype; | ||
var name = constructor.displayName || constructor.name; | ||
var nameLooksRight = 'GeneratorFunction' == name; | ||
var methodsLooksRight = 'function' == typeof proto.next && | ||
'function' == typeof proto.throw; | ||
return nameLooksRight || methodsLooksRight; | ||
if (!constructor) return false; | ||
if ('GeneratorFunction' === constructor.name || 'GeneratorFunction' === constructor.displayName) return true; | ||
return isGenerator(constructor.prototype); | ||
} | ||
@@ -226,0 +225,0 @@ |
{ | ||
"name": "co", | ||
"version": "4.3.1", | ||
"version": "4.4.0", | ||
"description": "generator async control flow goodness", | ||
@@ -13,3 +13,2 @@ "keywords": [ | ||
"devDependencies": { | ||
"bluebird": "^2.0.0", | ||
"istanbul-harmony": "0", | ||
@@ -20,3 +19,3 @@ "mocha": "^2.0.0", | ||
"scripts": { | ||
"test": "mocha --harmony --reporter spec", | ||
"test": "mocha --harmony", | ||
"test-cov": "node --harmony node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha -- --reporter dot", | ||
@@ -32,4 +31,4 @@ "test-travis": "node --harmony node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha --report lcovonly -- --reporter dot" | ||
"iojs": ">= 1.0.0", | ||
"node": ">= 0.11.16" | ||
"node": ">= 0.12.0" | ||
} | ||
} |
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
15440
3
203