Side navigation
#5971 closed bug (fixed)
Opened January 28, 2010 07:08PM UTC
Closed March 08, 2010 02:22AM UTC
Last modified March 08, 2010 04:26PM UTC
Make sure jQuery.data( elem ) always returns an object
Reported by: | john | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | 1.4.2 |
Component: | data | Version: | 1.4.1 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
Right now it'll return null if no data object exists.
Attachments (0)
Change History (5)
Changed January 28, 2010 07:13PM UTC by comment:1
resolution: | → fixed |
---|---|
status: | new → closed |
Changed March 06, 2010 12:09AM UTC by comment:2
resolution: | fixed |
---|---|
status: | closed → reopened |
I just came across another bug, where page unload pukes on this line in jQuery 1.4.2:
var events = jQuery.data(this, "events"), handlers = events[ event.type ];
.. should be ..
var events = jQuery.data(this, "events"), handlers = events ? events[ event.type ] : null;
I logged in to report this bug but it seems this (#5971) should have fixed this. I may be misunderstanding "Milestone" field but this defect remains in 1.4.2.
Changed March 08, 2010 02:22AM UTC by comment:3
resolution: | → fixed |
---|---|
status: | reopened → closed |
You're mis-understanding the bug - that's a separate case where you're requesting a specific property where it (apparently) doesn't exist any more. What you're describing is ticket #6163 and it's already been fixed.
Changed March 08, 2010 04:26PM UTC by comment:5
.. and shouldn't have. (oops)
Fixed.
http://github.com/jquery/jquery/commit/eed69eccc54d010889b5d8495320538d7ceb4e51