Side navigation
#10831 closed bug (invalid)
Opened November 18, 2011 06:24PM UTC
Closed November 18, 2011 08:11PM UTC
inArray is broken on IE7 and 8 at least when called with just 2 params
Reported by: | rr.rosas@gmail.com | Owned by: | rr.rosas@gmail.com |
---|---|---|---|
Priority: | undecided | Milestone: | None |
Component: | core | Version: | 1.7.1rc1 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
I've experienced an issue with IE 7 and 8 where $.inArray(elem, array) returned -1 while $.inArray(elem, array, 0) returned 3.
It turns out that Array.prototype.indexOf.call(array, elem, undefined) returns -1 in some IE7/8 mode (not sure if in Quirks mode or the opposite). jQuery should change this to:
Array.prototype.indexOf.call(array, elem, i === undefined ? 0 : i)
Or something similar.
Attachments (0)
Change History (4)
Changed November 18, 2011 06:37PM UTC by comment:1
component: | unfiled → core |
---|---|
owner: | → rr.rosas@gmail.com |
status: | new → pending |
Changed November 18, 2011 06:54PM UTC by comment:2
status: | pending → new |
---|
Humm... so sorry, I've just realized this is not a jQuery bug since IE8 doesn't support indexOf. I was foolished by the es5-shim project. I'll open a bug report there and you can close this one.
Changed November 18, 2011 06:58PM UTC by comment:3
I've opened a new issue there:
Changed November 18, 2011 08:11PM UTC by comment:4
resolution: | → invalid |
---|---|
status: | new → closed |
Thank you
Thanks for taking the time to contribute to the jQuery project! Please provide a complete reduced test case on jsFiddle to help us assess your ticket!
Additionally, be sure to test against the "jQuery (edge)" version to ensure the issue still exists. To get you started, use this boilerplate: http://jsfiddle.net/FrKyN/
Open the link and click to "Fork" (in the top menu) to get started.