Skip to main content

Bug Tracker

Side navigation

#14092 closed bug (notabug)

Opened July 02, 2013 10:23AM UTC

Closed July 04, 2013 08:04PM UTC

Error on triggering event on an element with no handlers.

Reported by: lukasz.chelmicki@gmail.com Owned by: lukasz.chelmicki@gmail.com
Priority: undecided Milestone: None
Component: unfiled Version: 2.0.2
Keywords: Cc:
Blocked by: Blocking:
Description

on line 4691 there is :

4688: event.data = handleObj.data;
4689: event.handleObj = handleObj;
4690: 
4691: ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler )
4692:     .apply( matched.elem, args );

In this line there is no check if handler exists. My solution to that is:

4688: event.data = handleObj.data;
4689: event.handleObj = handleObj;
4690:
4691: var tmp_handler = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler );
4692: if (typeof tmp_handler === 'function') {
4693:   ret = tmp_handler.apply( matched.elem, args );
4694: }

I noticed this in version 1.7.2 but it exists in all version up to date.

Attachments (0)
Change History (5)

Changed July 02, 2013 12:41PM UTC by dmethvin comment:1

owner: → lukasz.chelmicki@gmail.com
status: newpending

Do you have an example of code that causes an error? Please create one in jsfiddle.

Changed July 02, 2013 06:31PM UTC by lukasz.chelmicki@gmail.com comment:2

status: pendingnew

Replying to [comment:1 dmethvin]:

Do you have an example of code that causes an error? Please create one in jsfiddle.

I'll give an example tomorrow at work.

Changed July 04, 2013 04:59PM UTC by timmywil comment:3

status: newpending

Changed July 04, 2013 07:30PM UTC by lukasz.chelmicki@gmail.com comment:4

status: pendingnew

I tried to reproduce this bug. but it may have been the result of too many recursions. I was passing events between two windows.

You can reject this ticket.

Changed July 04, 2013 08:04PM UTC by timmywil comment:5

resolution: → notabug
status: newclosed

Thanks for looking into it further.