Skip to content

Commit ce190f4

Browse files
committed
Test for IE11 compat bug
1 parent 15a757d commit ce190f4

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
@@ -556,6 +556,7 @@
556556
ok(!_.isFunction(undefined), 'undefined vars are not functions');
557557
ok(!_.isFunction([1, 2, 3]), 'arrays are not functions');
558558
ok(!_.isFunction('moe'), 'strings are not functions');
559+
ok(!_.isFunction(document.createElement('div')), 'elements are not functions');
559560
ok(_.isFunction(_.isFunction), 'but functions are');
560561
ok(_.isFunction(iFunction), 'even from another frame');
561562
ok(_.isFunction(function(){}), 'even anonymous ones');
@@ -626,6 +627,22 @@
626627
ok(!_.isNull(xml));
627628
ok(!_.isUndefined(xml));
628629
});
630+
631+
test('#1621 IE 11 compat mode DOM elements are not functions', function() {
632+
var fn = function() {};
633+
var xml = new ActiveXObject('Msxml2.DOMDocument.3.0');
634+
var div = document.createElement('div');
635+
636+
// JIT the function
637+
var count = 200;
638+
while (count--) {
639+
_.isFunction(fn);
640+
}
641+
642+
equal(_.isFunction(xml), false);
643+
equal(_.isFunction(div), false);
644+
equal(_.isFunction(fn), true);
645+
});
629646
}
630647

631648
test('tap', function() {

0 commit comments

Comments
 (0)