Add _.isFunction test for its fallback.

This commit is contained in:
John-David Dalton
2014-11-13 23:12:27 -08:00
parent cfffad73eb
commit 5d4187bf03

View File

@@ -6498,6 +6498,20 @@
strictEqual(_.isFunction('a'), false);
});
test('should work using its fallback', 3, function() {
var lodash = _.runInContext(_.assign({}, root, {
'Uint8Array': {
'toString': function() {
return String(Uint8Array || Array);
}
}
}));
strictEqual(lodash.isFunction(slice), true);
strictEqual(lodash.isFunction(/x/), false);
strictEqual(lodash.isFunction(Uint8Array), !!Uint8Array);
});
test('should work with host objects in IE 8 document mode (test in IE 11)', 2, function() {
// trigger Chakra bug
// https://github.com/jashkenas/underscore/issues/1621