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

[Release] Increase to version 1.1.2 (and Fix for #31) #32

Merged
merged 1 commit into from
Apr 16, 2021

Conversation

MSNev
Copy link
Collaborator

@MSNev MSNev commented Apr 16, 2021

[BUG] _checkPrototype function loops indefinitely when calling Invoke-WebRequest cmdlet against a docs.microsoft.com webpage #31

[BUG] _checkPrototype function loops indefinitely when calling Invoke-WebRequest cmdlet against a docs.microsoft.com webpage #31
@@ -135,7 +135,7 @@ function _getObjProto(target:any) {
}

// target[Constructor] May break if the constructor has been changed or removed
let newProto = target[str__Proto] || target[Prototype] || target[Constructor];
let newProto = target[str__Proto] || target[Prototype] || (target[Constructor] ? target[Constructor][Prototype] : null);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the root location of the issue, when IE is running in IE7 mode target.__proto__ (target[str__Proto]) and target.prototype (target[Prototype]) don't exist on the root prototype and the final fallback of the target.constructor is also incomplete.

This issue ONLY affects IE7... Which is not strictly supported, but this was causing an endless loop in _checkPrototype()

// This method doesn't existing in older browsers (e.g. IE8)
if (_objGetPrototypeOf) {
// As this is primarily a coding time check, don't bother checking if running in IE8 or lower
let visited:any[] = [];
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copied the visited workaround (to avoid the endless loop) from the previous fix from March -- which fixed IE8 support

@MSNev MSNev merged commit 0260f32 into master Apr 16, 2021
@MSNev MSNev added this to the 1.1.2 milestone Apr 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants