Bug Tracker

Opened 8 years ago

Closed 8 years ago

#10831 closed bug (invalid)

inArray is broken on IE7 and 8 at least when called with just 2 params

Reported by: rr.rosas@… Owned by: rr.rosas@…
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.

Change History (4)

comment:1 Changed 8 years ago by Rick Waldron

Component: unfiledcore
Owner: set to rr.rosas@…
Status: newpending

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.

comment:2 Changed 8 years ago by rr.rosas@…

Status: pendingnew

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.

comment:3 Changed 8 years ago by anonymous

comment:4 Changed 8 years ago by timmywil

Resolution: invalid
Status: newclosed

Thank you

Note: See TracTickets for help on using tickets.