Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[fix] It returns a different type for generators
  • Loading branch information
3rd-Eden committed Sep 3, 2015
1 parent 7551e1e commit 221f03c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion index.js
Expand Up @@ -728,8 +728,10 @@ Assert.add('generator', function generators(msg) {
//
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/isGenerator
//
if ('function' === this.value.isGenerator) {
if ('function' === typeof this.value.isGenerator) {
result = this.value.isGenerator();
} else if ('generatorfunction' === type(this.value)) {
result = true;
} else {
result = 'function' === type(this.value) && this.value.toString().indexOf('function*') === 0;
}
Expand Down

0 comments on commit 221f03c

Please sign in to comment.