Shortcircuit fix if possible

This commit is contained in:
Rick Waldron 2011-09-22 11:30:03 -04:00
parent dc878ae33b
commit 14cb04dc94

View File

@ -492,6 +492,11 @@ jQuery.event = {
event = jQuery.Event( originalEvent ); event = jQuery.Event( originalEvent );
propHook = jQuery.event.propHooks[ event.type ]; propHook = jQuery.event.propHooks[ event.type ];
// Determine if an early return is possible
if ( !propHook && ( event.target && event.target.nodeType !== 3 ) && event.relatedTarget ) {
return event;
}
for ( var i = this.props.length, prop; i; ) { for ( var i = this.props.length, prop; i; ) {
prop = this.props[ --i ]; prop = this.props[ --i ];
event[ prop ] = originalEvent[ prop ]; event[ prop ] = originalEvent[ prop ];