Bug Tracker

Opened 13 years ago

Closed 12 years ago

#6676 closed bug (duplicate)

.unbind causes "elem.removeEventListener is not a function" at #2070 for non-DOM objects

Reported by: mu Owned by:
Priority: Milestone: 1.4.2
Component: event Version: 1.4.2
Keywords: Cc:
Blocked by: Blocking:


If JQuery event handlers are bound to non-DOM JS objects, .unbind throws an error while unbinding the last listener. removeElement on line 2068 makes an assumption that the passed in 'elem' param is a DOM object.

The issue is NOT found in 1.3.2.

Sample test case:

<head><script src="http://code.jquery.com/jquery-1.4.2.js"></script></head>

<script language="javascript">
var m = {};

$(m).bind("myevent.f1", function (){});	
$(m).bind("myevent.f2", function (){});


 The following line causes a JS Error at jquery-1.4.2.js (line 2070).

elem.removeEventListener is not a function
elem.removeEventListener( type, handle, false );   


Change History (1)

comment:1 Changed 12 years ago by dmethvin

Resolution: duplicate
Status: newclosed

Dup of #6184.

Note: See TracTickets for help on using tickets.