Skip to content

Commit c768be4

Browse files
authoredJul 29, 2021
Update object-create.js
1 parent 5aa8320 commit c768be4

File tree

1 file changed

+16
-8
lines changed

1 file changed

+16
-8
lines changed
 

‎packages/core-js/internals/object-create.js

+16-8
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,22 @@ var NullProtoObjectViaIFrame = function () {
3333
var iframe = documentCreateElement('iframe');
3434
var JS = 'java' + SCRIPT + ':';
3535
var iframeDocument;
36-
iframe.style.display = 'none';
37-
html.appendChild(iframe);
38-
// https://github.com/zloirock/core-js/issues/475
39-
iframe.src = String(JS);
40-
iframeDocument = iframe.contentWindow.document;
41-
iframeDocument.open();
42-
iframeDocument.write(scriptTag('document.F=Object'));
43-
iframeDocument.close();
36+
if (iframe.style) {
37+
iframe.style.display = 'none';
38+
html.appendChild(iframe);
39+
// https://github.com/zloirock/core-js/issues/475
40+
iframe.src = String(JS);
41+
iframeDocument = iframe.contentWindow.document;
42+
iframeDocument.open();
43+
iframeDocument.write(scriptTag('document.F=Object'));
44+
iframeDocument.close();
45+
} else {
46+
/* global ActiveXObject -- in WSH */
47+
activeXDocument = new ActiveXObject('htmlfile'); // without document.domain
48+
iframeDocument = {
49+
F: NullProtoObjectViaActiveX(activeXDocument)
50+
};
51+
}
4452
return iframeDocument.F;
4553
};
4654

0 commit comments

Comments
 (0)
Please sign in to comment.