diff options
author | Dave Methvin <dave.methvin@gmail.com> | 2011-04-12 17:46:15 -0400 |
---|---|---|
committer | Dave Methvin <dave.methvin@gmail.com> | 2011-04-12 17:46:15 -0400 |
commit | 352715bd0802e2df041f86e1a82669574183ec04 (patch) | |
tree | 8ea09288d0fc0597183b235c19ae598ce19f1a48 /src/event.js | |
parent | 7fa6de0ec16df46b90a862778e16c4091198870d (diff) | |
download | jquery-352715bd0802e2df041f86e1a82669574183ec04.tar.gz jquery-352715bd0802e2df041f86e1a82669574183ec04.zip |
Use explicit "new jQuery.Event" to avoid double-function-call overhead.
Diffstat (limited to 'src/event.js')
-rw-r--r-- | src/event.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/event.js b/src/event.js index b8a2e37ec..5e2baf0d2 100644 --- a/src/event.js +++ b/src/event.js @@ -314,9 +314,9 @@ jQuery.event = { // jQuery.Event object event[ jQuery.expando ] ? event : // Object literal - jQuery.extend( jQuery.Event(type), event ) : + jQuery.extend( new jQuery.Event(type), event ) : // Just the event type (string) - jQuery.Event(type); + new jQuery.Event(type); event.namespace = namespaces.join("."); event.namespace_re = new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.)?") + "(\\.|$)"); event.exclusive = exclusive; @@ -989,7 +989,7 @@ jQuery.fn.extend({ triggerHandler: function( type, data ) { if ( this[0] ) { - var event = jQuery.Event( type ); + var event = new jQuery.Event( type ); event.preventDefault(); event.stopPropagation(); jQuery.event.trigger( event, data, this[0] ); |