Skip to content

object-create在非浏览器环境下会报错 #1395

@rabit2022

Description

@rabit2022

iframe.style.display = 'none';
html.appendChild(iframe);
iframeDocument = iframe.contentWindow.document;
iframeDocument.open();
iframeDocument.write(scriptTag('document.F=Object'));
iframeDocument.close();

这个分支的代码会报错,es3非浏览器环境下,没有处理iframe={}的情况,html为空的情况,

NullProtoObject = typeof document != 'undefined' ?
document.domain && activeXDocument ?
NullProtoObjectViaActiveX(activeXDocument) // old IE
:
NullProtoObjectViaIFrame() :
NullProtoObjectViaActiveX(activeXDocument); // WSH

没有考虑更多情况

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions