Skip to main content

Bug Tracker

Side navigation

#4830 closed bug (duplicate)

Opened June 29, 2009 09:13PM UTC

Closed June 30, 2009 01:58AM UTC

Passing undefined to jQuery when called with remove silently deletes the data store

Reported by: Keith Bentrup Owned by:
Priority: critical Milestone: 1.4
Component: unfiled Version: 1.3.2
Keywords: jquery document data store undefined Cc:
Blocked by: Blocking:


Compare this:




to this:




If thisx is undefined, it will immediatly throw a reference error. If x is an undefined property of this, jQuery will return the document as it's result set instead. Next jQuery will attempt to remove your document (which it can't), but before doing that it will remove all data attached to any child element of the document. Thus, wiping out your data store.

Note: this can be any element reference or object. You only need to have jQuery attempt to access an undefined property.

Possible solution:

before selector = selector | | document; throw an error if arguments == 1 and that argument is undefined.

See first link for complete details and discussion.

Attachments (0)
Change History (1)

Changed June 30, 2009 01:58AM UTC by dmethvin comment:1

resolution: → duplicate
status: newclosed

Duplicate of #4578, should be fixed in 1.3.3.