Skip to main content

Bug Tracker

Side navigation

#10076 closed bug (fixed)

Opened August 17, 2011 03:15PM UTC

Closed August 25, 2011 07:22PM UTC

$.inArray crushes IE6 and Chrome if second argument is `null` or `undefined`

Reported by: Anton Ryzhov Owned by:
Priority: low Milestone: 1.6.3
Component: core Version: git
Keywords: Cc:
Blocked by: Blocking:

$.inArray crushes IE6 and Chrome if second argument is null or undefined, but in Firefox and Opera native functions returns -1.

Following patch unifies $.inArray behavior and avoids JS-engine from crush.

Test case is available here.

Patch and pull request is here.

Attachments (0)
Change History (4)

Changed August 17, 2011 04:35PM UTC by rwaldron comment:1

status: newopen

The real issue is that the correctly thrown TypeError is preventing the method from returning a value:

Uncaught TypeError: Array.prototype.indexOf called on null or undefined

Changed August 17, 2011 04:36PM UTC by rwaldron comment:2

component: unfiledcore
milestone: None1.6.3
priority: undecidedlow

Changed August 25, 2011 06:43PM UTC by rwaldron comment:3

Changed August 25, 2011 07:22PM UTC by Dave Methvin comment:4

resolution: → fixed
status: openclosed

Merge pull request #465 from anton-ryzhov/master

Fixes #10076. $.inArray crashes IE6 and Chrome if second argument is null or undefined (Thanks anton-ryzhov!)

Changeset: a839af034db2bd934e4d4fa6758a3fed8de74174