Bug Tracker

Modify

Ticket #10831 (closed bug: invalid)

Opened 18 months ago

Last modified 18 months ago

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:
Blocking: Blocked by:

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

comment:1 Changed 18 months ago by rwaldron

  • Owner set to rr.rosas@…
  • Status changed from new to pending
  • Component changed from unfiled to core

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 18 months ago by rr.rosas@…

  • Status changed from pending to 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.

comment:3 Changed 18 months ago by anonymous

I've opened a new issue there:

 https://github.com/kriskowal/es5-shim/issues/73

comment:4 Changed 18 months ago by timmywil

  • Status changed from new to closed
  • Resolution set to invalid

Thank you

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.