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

Many tests broken in ie8 #114

Closed
lukeasrodgers opened this issue Apr 12, 2012 · 19 comments
Closed

Many tests broken in ie8 #114

lukeasrodgers opened this issue Apr 12, 2012 · 19 comments

Comments

@lukeasrodgers
Copy link

Using real ie8 (i.e. not ie9's "act as ie8" mode), 57 of the 156 tests are currently failing for me in ie8. Many of these issues are not mentioned under the "dubious shims" section in the README (e.g. tests for filter, indexOf fail).

Using ie9's emulate ie8 mode, I get 3 failures, all for Object.isExtensible.

@kriskowal
Copy link
Member

Thanks. Any help with this would be appreciated.

@ghost
Copy link

ghost commented Apr 13, 2012

The 56 tests in question fail on my IE 8 VM as well. Investigating now...

@lukeasrodgers
Copy link
Author

Yeah, beginning to look further into this, and it seems like many, perhaps almost all, of these issues are related to the way IE8 (I suspect IE7 as well, but don't know for sure) handles for ... in and also obj.hasOwnProperty. A workaround is not immediately obvious to me.

@kriskowal
Copy link
Member

It might be useful to do the full Object.prototype.hasOwnProperty.call(object, key) incantation somewhere to isolate the issue.

@lukeasrodgers
Copy link
Author

Tried that, to no avail.

It may be worth noting that the lone underscore.js test that fails for me in ie8 is related to precisely this same issue.

@ghost
Copy link

ghost commented Apr 13, 2012

@lukeasrodgers What's the failing Underscore test?

@lukeasrodgers
Copy link
Author

_.uniq, which fails on the test where undefined is an element of an array.

@ghost
Copy link

ghost commented Apr 13, 2012

Sounds like it's a sparse array bug...IE <= 8 treats undefined array elements as elisions. That's why the es5-shim Array#indexOf(undefined) test fails—the undefined element does't exist.

The test array is [2, 3, undefined, true, 'hej', null, 2, false, 0], but IE sees it as [2, 3, , true, 'hej', null, 2, false, 0]. [2, 3, , true, 'hej', null, 2, false, 0].indexOf(undefined) == -1.

@javadoug
Copy link

Any progress on this issue? I can invest a little time to see if I can fix the these ... but don't want to spend time if someone is doing this.

@kriskowal
Copy link
Member

No one is presently researching the issue. We can’t fix the IE<=8 elision bug, but we can rewrite the test to not have undefined. If you’ve got the time, I’ve got the trigger finger on the merge button.

@javadoug
Copy link

Hi Kris,

I've got some time...but not sure I have the full understanding of the underlying issues. Is there any documentation you suggest I read to get up to speed? I will google around for the "IE<=8 elision bug." What do you want/need me to do for this "rewrite the test to not have undefined"?

Doug

On Oct 9, 2012, at 10:27 PM, Kris Kowal wrote:

No one is presently researching the issue. We can’t fix the IE<=8 elision bug, but we can rewrite the test to not have undefined. If you’ve got the time, I’ve got the trigger finger on the merge button.


Reply to this email directly or view it on GitHub.

@usmonster
Copy link

I haven't investigated this issue, but it sounds like a manifestation of the infamous IE DontEnum Bug. There are viable workarounds floating around the internet if you google it. Hope this helps!

@kriskowal
Copy link
Member

It is the DontEnum bug. IE’s don’t recognize the difference between array holes and explicitly enumerable but undefined properties. This makes it difficult, possibly unreasonable, or simply impossible for ES5-Shim to emulate Array methods that respect holes. So, it’s a tricky situation. We could separate the specs that we don’t expect to work in older IE’s. I would prefer not to drop them entirely, since we do implement them properly for older FF’s and Safari’s. But, it also becomes a question of whether it is ES5-Shim’s job to level the playing field to the lowest common denominator, as we did when separating ES5-Sham.

@waseemvnb
Copy link

For ie8 there is no native support for html 5 functions such as. .. forEach, filter, indexOf, bind, search etc. So you need to define these methods ss prototype functions, like .forEach as Array.prototype.forEach , then define the function for the same. . Regsrds, Waseem Vellore

@SLaks
Copy link

SLaks commented Sep 11, 2013

Yes; that's exactly what this entire project does (and those have nothing to do with HTML5).

This problem is more complicated

@ljharb
Copy link
Member

ljharb commented Dec 23, 2013

57 test are still failing. Only the 3 failing tests for Object.isExtensible in es5-sham seem to be fixable - the other 54 seem related to the intractable JScript 5 bug treating undefined values and array holes as the same (#190, #131) for which there seems to be no solution.

@lukescott
Copy link

I hit this today:

var properties = {
    constructor: {}
};
for (var name in properties) {
    console.log(name); // <-- constructor is never iterated even though it is user defined
}

Specifically Object.create and Object.defineProperties will not pickup the user defined constructor property. Although this doesn't seem to work in most shims I've tried. Works in core-js though.

@ljharb
Copy link
Member

ljharb commented Feb 7, 2015

Object.create and Object.defineProperties aren't in the shim, only the sham - quirks with them are to be expected.

@ljharb
Copy link
Member

ljharb commented Nov 8, 2015

I've added a feature detection to the array tests to determine when it's in an engine that can't distinguish between an absent item, and a present undefined - namely, IE 6-8.

This leaves only 3 Array tests failing in IE 8 (filed as #341), and all Array tests passing in IE 6 and 7.

Any remaining failures in IE 6-8 are real, and either already have issues filed, or, need issues to be filed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants