File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change 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' ) ;
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 ( ) {
You can’t perform that action at this time.
0 commit comments