Retooled the arguments.callee-related changes in 98ce35d52b
to avoid re-declarations where possible.
This commit is contained in:
parent
fe9333cc79
commit
9997620420
2 changed files with 57 additions and 31 deletions
11
src/event.js
11
src/event.js
|
@ -37,13 +37,20 @@ jQuery.event = {
|
|||
|
||||
// Init the element's event structure
|
||||
var events = jQuery.data( elem, "events" ) || jQuery.data( elem, "events", {} ),
|
||||
handle = jQuery.data( elem, "handle" ) || jQuery.data( elem, "handle", function eventHandle() {
|
||||
handle = jQuery.data( elem, "handle" ), eventHandle;
|
||||
|
||||
if ( !handle ) {
|
||||
eventHandle = function() {
|
||||
// Handle the second event of a trigger and when
|
||||
// an event is called after a page has unloaded
|
||||
return typeof jQuery !== "undefined" && !jQuery.event.triggered ?
|
||||
jQuery.event.handle.apply( eventHandle.elem, arguments ) :
|
||||
undefined;
|
||||
});
|
||||
};
|
||||
|
||||
handle = jQuery.data( elem, "handle", eventHandle );
|
||||
}
|
||||
|
||||
// Add elem as a property of the handle function
|
||||
// This is to prevent a memory leak with non-native
|
||||
// event in IE.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue