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

IE8 Fix for host object array filter #12334

Merged
merged 1 commit into from
Sep 13, 2015

Conversation

acid-srvnn
Copy link

[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}); causes Object doesn't support property or method 'hasOwnProperty' error.

@@ -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)) {
Copy link
Member

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);

Copy link
Author

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?

Copy link
Member

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.

Copy link
Author

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..

@stefanpenner stefanpenner added this to the 1.13-maintenance milestone Sep 12, 2015
@stefanpenner
Copy link
Member

LGTM, can you squash your commits ?

IE8 doesn't define hasOwnProperty for host objects
rwjblue added a commit that referenced this pull request Sep 13, 2015
IE8 Fix for host object array filter
@rwjblue rwjblue merged commit 176ef57 into emberjs:release-1-13 Sep 13, 2015
@rwjblue
Copy link
Member

rwjblue commented Sep 13, 2015

Thank you!

@acid-srvnn acid-srvnn deleted the release-1-13 branch September 14, 2015 15:55
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.

3 participants