Bug Tracker

Opened 10 years ago

Closed 10 years ago

#5514 closed enhancement (fixed)

Move try..catch outside loop in withinElement function

Reported by: R Owned by: brandon
Priority: minor Milestone: 1.4
Component: event Version: 1.3.2
Keywords: Cc:
Blocked by: Blocking:

Description

In the withinElement function used by mouseenter and mouseleave events try..catch statement is placed inside the while loop, where its task is to break the loop. So, why not place the loop inside the try..catch and let the exception stop the looping?

try {

while(parent && parent !== this){

parent = parent.parentNode;

}

} catch(e){

parent = this; for jQuery 1.3.2 behavior. In jQuery 1.4 nightly, just skip this line

}

Attachments (1)

withinElement.js (684 bytes) - added by R 10 years ago.
updated withinElement function

Download all attachments as: .zip

Change History (2)

Changed 10 years ago by R

Attachment: withinElement.js added

updated withinElement function

comment:1 Changed 10 years ago by dmethvin

Resolution: fixed
Status: newclosed

Fixed in 1.4.

Note: See TracTickets for help on using tickets.