Comparing version 4.2.0 to 4.3.0
4.3.0 / 2014-02-05 | ||
================== | ||
* check for generator functions in a ES5-transpiler-friendly way | ||
4.2.0 / 2015-01-20 | ||
@@ -3,0 +8,0 @@ ================== |
18
index.js
@@ -214,17 +214,13 @@ | ||
*/ | ||
function isGeneratorFunction(obj) { | ||
return obj && obj.constructor == generator.constructor; | ||
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; | ||
} | ||
/** | ||
* Empty generator function for constructor comparison. | ||
* This allows comparisons to work with ES6 transpilers. | ||
* | ||
* @api private | ||
*/ | ||
function* generator() {} | ||
/** | ||
* Check for plain object. | ||
@@ -231,0 +227,0 @@ * |
{ | ||
"name": "co", | ||
"version": "4.2.0", | ||
"version": "4.3.0", | ||
"description": "generator async control flow goodness", | ||
@@ -19,5 +19,5 @@ "keywords": [ | ||
"scripts": { | ||
"test": "mocha --harmony-generators --reporter spec", | ||
"test-cov": "node --harmony-generators node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha -- --reporter dot", | ||
"test-travis": "node --harmony-generators node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha --report lcovonly -- --reporter dot" | ||
"test": "mocha --harmony --reporter spec", | ||
"test-cov": "node --harmony node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha -- --reporter dot", | ||
"test-travis": "node --harmony node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha --report lcovonly -- --reporter dot" | ||
}, | ||
@@ -30,4 +30,5 @@ "files": [ | ||
"engines": { | ||
"node": ">= 0.11.13" | ||
"iojs": ">= 1.0.0", | ||
"node": ">= 0.11.16" | ||
} | ||
} |
@@ -56,2 +56,4 @@ # co | ||
io.js is supported out of the box, you can use `co` without flags or polyfills. | ||
## Installation | ||
@@ -58,0 +60,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
15382
211
204