Skip to main content

Bug Tracker

Side navigation

#14990 closed bug (notabug)

Opened April 11, 2014 11:36AM UTC

Closed April 11, 2014 12:39PM UTC

jquery 1.11 not working on objects with attribute .length = 0

Reported by: Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.11.0
Keywords: Cc:
Blocked by: Blocking:

If there is an object that does got an attribute "length" which value is 0 jquery can not be used on it.

>> jQuery({length:0})


>> jQuery({length:1})


This is unexpected behaviour, horrible to debug and the source code does not provide a reasoning behind the check. (see function isArrayLike)

Attachments (0)
Change History (2)

Changed April 11, 2014 12:13PM UTC by anonymous comment:1

I was asked on IRC to provide examples how this can turn into a problem here are two examples:

Changed April 11, 2014 12:39PM UTC by dmethvin comment:2

resolution: → notabug
status: newclosed

That is the way it's supposed to work.

I've submitted a docs issue, feel free to make a pull request.