Bug Tracker

Modify

Ticket #6769 (closed bug)

Opened 3 years ago

Last modified 2 years ago

in IE8, jQuery.inArray call fails with error "'indexOf' is null or not an object"

Reported by: riamu Owned by: riamu
Priority: low Milestone: 1.4.3
Component: core Version: 1.4.2
Keywords: IE explorer inArray indexOf Cc:
Blocking: Blocked by:

Description

The method currently tests for existence using basic syntax:

if ( array.indexOf ) {

return array.indexOf( elem );

}

Suggest changing it to:

if (typeof array.indexOf == 'function') {

return array.indexOf( elem );

}

Change History

comment:1 Changed 3 years ago by addyosmani

  • need changed from Review to Test Case
  • Owner set to riamu
  • Status changed from new to pending
  • Priority set to low

Could you please supply a valid test case here for us to evaluate?

comment:2 Changed 3 years ago by trac-o-bot

  • Status changed from pending to closed

Automatically closed due to 14 days of inactivity.

comment:3 Changed 2 years ago by marksyzm@…

This matter is resolved with the above as this circumstance only occurs when the array is null.

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.