From c768be4c8017b9614e130b6a9b8b9945601f860d Mon Sep 17 00:00:00 2001 From: "Namhyeon, Go" Date: Thu, 29 Jul 2021 12:27:00 +0900 Subject: [PATCH] Update object-create.js --- packages/core-js/internals/object-create.js | 24 ++++++++++++++------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/packages/core-js/internals/object-create.js b/packages/core-js/internals/object-create.js index a9e26145ecfc..81a7e7b34108 100644 --- a/packages/core-js/internals/object-create.js +++ b/packages/core-js/internals/object-create.js @@ -33,14 +33,22 @@ var NullProtoObjectViaIFrame = function () { var iframe = documentCreateElement('iframe'); var JS = 'java' + SCRIPT + ':'; var iframeDocument; - iframe.style.display = 'none'; - html.appendChild(iframe); - // https://github.com/zloirock/core-js/issues/475 - iframe.src = String(JS); - iframeDocument = iframe.contentWindow.document; - iframeDocument.open(); - iframeDocument.write(scriptTag('document.F=Object')); - iframeDocument.close(); + if (iframe.style) { + iframe.style.display = 'none'; + html.appendChild(iframe); + // https://github.com/zloirock/core-js/issues/475 + iframe.src = String(JS); + iframeDocument = iframe.contentWindow.document; + iframeDocument.open(); + iframeDocument.write(scriptTag('document.F=Object')); + iframeDocument.close(); + } else { + /* global ActiveXObject -- in WSH */ + activeXDocument = new ActiveXObject('htmlfile'); // without document.domain + iframeDocument = { + F: NullProtoObjectViaActiveX(activeXDocument) + }; + } return iframeDocument.F; };