Ensure _.isFunction returns true for generator functions. [closes #1498]

This commit is contained in:
John-David Dalton
2015-10-01 08:55:49 -07:00
parent 8842fa209d
commit d407d8aa08
2 changed files with 16 additions and 1 deletions

View File

@@ -8549,6 +8549,16 @@
assert.strictEqual(_.isFunction(slice), true);
});
QUnit.test('should return `true` for generator functions', function(assert) {
assert.expect(1);
var generator = _.attempt(function() {
return Function('return function*(){}');
});
assert.strictEqual(_.isFunction(generator), typeof generator == 'function');
});
QUnit.test('should return `true` for typed array constructors', function(assert) {
assert.expect(1);