-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
IE8 Fix for host object array filter #12334
Conversation
@@ -101,7 +101,7 @@ var filter = defineNativeShim(ArrayPrototype.filter, function(fn, context) { | |||
var length = this.length; | |||
|
|||
for (i = 0; i < length; i++) { | |||
if (this.hasOwnProperty(i)) { | |||
if (typeof this.hasOwnProperty !== 'function' || this.hasOwnProperty(i)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should instead be Object.prototype.hasOwnProperty.call(this, i);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@stefanpenner I replaced that code. But then Travis CI test failed for Safari. Not able to find the reason so i reverted back to same code which passed before. Now Travis CI test fails for IE9. Issue with travis?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The cross browser builds are finicky, please change this back as Stef mentioned and I'll restart the build if it fails again.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rwjblue Yes, the same code passed now..
LGTM, can you squash your commits ? |
IE8 doesn't define hasOwnProperty for host objects
0ecaad9
to
e893af9
Compare
IE8 Fix for host object array filter
Thank you! |
[BUGFIX release-1-13] IE8 doesn't define hasOwnProperty for host objects, So execution of
Array.prototype.filter.call(document.getElementsByTagName('li'),function(){return true});
causesObject doesn't support property or method 'hasOwnProperty'
error.