1
+ /* global ActiveXObject -- old IE, WSH */
1
2
var anObject = require ( '../internals/an-object' ) ;
2
3
var defineProperties = require ( '../internals/object-define-properties' ) ;
3
4
var enumBugKeys = require ( '../internals/enum-bug-keys' ) ;
@@ -42,14 +43,8 @@ var NullProtoObjectViaIFrame = function () {
42
43
iframeDocument . open ( ) ;
43
44
iframeDocument . write ( scriptTag ( 'document.F=Object' ) ) ;
44
45
iframeDocument . close ( ) ;
45
- } else {
46
- /* global ActiveXObject -- in WSH */
47
- activeXDocument = new ActiveXObject ( 'htmlfile' ) ; // without document.domain
48
- iframeDocument = {
49
- F : NullProtoObjectViaActiveX ( activeXDocument )
50
- } ;
46
+ return iframeDocument . F ;
51
47
}
52
- return iframeDocument . F ;
53
48
} ;
54
49
55
50
// Check for document.domain and active x support
@@ -60,10 +55,12 @@ var NullProtoObjectViaIFrame = function () {
60
55
var activeXDocument ;
61
56
var NullProtoObject = function ( ) {
62
57
try {
63
- /* global ActiveXObject -- old IE */
64
- activeXDocument = document . domain && new ActiveXObject ( 'htmlfile' ) ;
58
+ activeXDocument = new ActiveXObject ( 'htmlfile' ) ;
65
59
} catch ( error ) { /* ignore */ }
66
- NullProtoObject = activeXDocument ? NullProtoObjectViaActiveX ( activeXDocument ) : NullProtoObjectViaIFrame ( ) ;
60
+ NullProtoObject = document . domain && activeXDocument ?
61
+ NullProtoObjectViaActiveX ( activeXDocument ) : // old IE
62
+ NullProtoObjectViaIFrame ( ) ||
63
+ NullProtoObjectViaActiveX ( activeXDocument ) ; // WSH
67
64
var length = enumBugKeys . length ;
68
65
while ( length -- ) delete NullProtoObject [ PROTOTYPE ] [ enumBugKeys [ length ] ] ;
69
66
return NullProtoObject ( ) ;
0 commit comments