Skip to content
Permalink
Browse files

Cache reference to propHook lookup and result

  • Loading branch information...
rwaldron committed Sep 22, 2011
1 parent 66202ae commit 7babc7f20393acb44d4fced34fe86fde65f893a0
Showing with 6 additions and 3 deletions.
  1. +6 −3 src/event.js
@@ -484,8 +484,11 @@ jQuery.event = {

// store a copy of the original event object
// and "clone" to set read-only properties
var originalEvent = event;
var originalEvent = event,
propHook;

event = jQuery.Event( originalEvent );
propHook = jQuery.event.propHooks[ event.type ];

for ( var i = this.props.length, prop; i; ) {
prop = this.props[ --i ];
@@ -510,8 +513,8 @@ jQuery.event = {
event.relatedTarget = event.fromElement === event.target ? event.toElement : event.fromElement;
}

if ( jQuery.event.propHooks[ event.type ] ) {
event = jQuery.event.propHooks[ event.type ]( event, originalEvent );
if ( propHook ) {
event = propHook( event, originalEvent );
}

return event;

0 comments on commit 7babc7f

Please sign in to comment.
You can’t perform that action at this time.