Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix crash in NullProtoObject() in WSH #970

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 9 additions & 4 deletions packages/core-js/internals/object-create.js
Expand Up @@ -57,10 +57,15 @@ var NullProtoObject = function () {
try {
activeXDocument = new ActiveXObject('htmlfile');
} catch (error) { /* ignore */ }
NullProtoObject = document.domain && activeXDocument ?
NullProtoObjectViaActiveX(activeXDocument) : // old IE
NullProtoObjectViaIFrame() ||
NullProtoObjectViaActiveX(activeXDocument); // WSH
if (activeXDocument) {
if (typeof(document) !== 'undefined') {
NullProtoObject = document.domain ?
NullProtoObjectViaActiveX(activeXDocument) : // old IE
NullProtoObjectViaIFrame();
} else {
NullProtoObject = NullProtoObjectViaActiveX(activeXDocument); // WSH
}
}
var length = enumBugKeys.length;
while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
return NullProtoObject();
Expand Down