@@ -46,16 +46,16 @@ var toStr = Object.prototype.toString;
46
46
var objectClass = '[object Object]' ;
47
47
var fnClass = '[object Function]' ;
48
48
var genClass = '[object GeneratorFunction]' ;
49
- var ddaClass = '[object HTMLAllCollection]' ;
49
+ var ddaClass = '[object HTMLAllCollection]' ; // IE 11
50
50
var ddaClass2 = '[object HTML document.all class]' ;
51
- var ddaClass3 = '[object HTMLCollection]' ; // opera 12.16
51
+ var ddaClass3 = '[object HTMLCollection]' ; // IE 9-10
52
52
var hasToStringTag = typeof Symbol === 'function' && ! ! Symbol . toStringTag ; // better: use `has-tostringtag`
53
53
54
54
var isIE68 = ! ( 0 in [ , ] ) ; // eslint-disable-line no-sparse-arrays, comma-spacing
55
55
56
56
var isDDA = function isDocumentDotAll ( ) { return false ; } ;
57
57
if ( typeof document === 'object' ) {
58
- // Firefox 3 canonicalized DDA to undefined when it's not accessed directly
58
+ // Firefox 3 canonicalizes DDA to undefined when it's not accessed directly
59
59
var all = document . all ;
60
60
if ( toStr . call ( all ) === toStr . call ( document . all ) ) {
61
61
isDDA = function isDocumentDotAll ( value ) {
@@ -64,8 +64,12 @@ if (typeof document === 'object') {
64
64
if ( ( isIE68 || ! value ) && ( typeof value === 'undefined' || typeof value === 'object' ) ) {
65
65
try {
66
66
var str = toStr . call ( value ) ;
67
- // IE 6-8 uses `objectClass`
68
- return ( str === ddaClass || str === ddaClass2 || str === ddaClass3 || str === objectClass ) && value ( '' ) == null ; // eslint-disable-line eqeqeq
67
+ return (
68
+ str === ddaClass
69
+ || str === ddaClass2
70
+ || str === ddaClass3 // opera 12.16
71
+ || str === objectClass // IE 6-8
72
+ ) && value ( '' ) == null ; // eslint-disable-line eqeqeq
69
73
} catch ( e ) { /**/ }
70
74
}
71
75
return false ;
@@ -78,13 +82,12 @@ module.exports = reflectApply
78
82
if ( isDDA ( value ) ) { return true ; }
79
83
if ( ! value ) { return false ; }
80
84
if ( typeof value !== 'function' && typeof value !== 'object' ) { return false ; }
81
- if ( typeof value === 'function' && ! value . prototype ) { return true ; }
82
85
try {
83
86
reflectApply ( value , null , badArrayLike ) ;
84
87
} catch ( e ) {
85
88
if ( e !== isCallableMarker ) { return false ; }
86
89
}
87
- return ! isES6ClassFn ( value ) ;
90
+ return ! isES6ClassFn ( value ) && tryFunctionObject ( value ) ;
88
91
}
89
92
: function isCallable ( value ) {
90
93
if ( isDDA ( value ) ) { return true ; }
0 commit comments