Skip to content

Commit 9ae4ad4

Browse files
committed
Merge pull request #1791 from akre54/ie11-isfn-test
test for IE11 compat bug
2 parents 6b2cf57 + ce190f4 commit 9ae4ad4

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

test/objects.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -577,6 +577,7 @@
577577
ok(!_.isFunction(undefined), 'undefined vars are not functions');
578578
ok(!_.isFunction([1, 2, 3]), 'arrays are not functions');
579579
ok(!_.isFunction('moe'), 'strings are not functions');
580+
ok(!_.isFunction(document.createElement('div')), 'elements are not functions');
580581
ok(_.isFunction(_.isFunction), 'but functions are');
581582
ok(_.isFunction(iFunction), 'even from another frame');
582583
ok(_.isFunction(function(){}), 'even anonymous ones');
@@ -647,6 +648,22 @@
647648
ok(!_.isNull(xml));
648649
ok(!_.isUndefined(xml));
649650
});
651+
652+
test('#1621 IE 11 compat mode DOM elements are not functions', function() {
653+
var fn = function() {};
654+
var xml = new ActiveXObject('Msxml2.DOMDocument.3.0');
655+
var div = document.createElement('div');
656+
657+
// JIT the function
658+
var count = 200;
659+
while (count--) {
660+
_.isFunction(fn);
661+
}
662+
663+
equal(_.isFunction(xml), false);
664+
equal(_.isFunction(div), false);
665+
equal(_.isFunction(fn), true);
666+
});
650667
}
651668

652669
test('tap', function() {

0 commit comments

Comments
 (0)