diff options
author | Dave Methvin <dave.methvin@gmail.com> | 2013-02-26 12:19:04 -0500 |
---|---|---|
committer | Dave Methvin <dave.methvin@gmail.com> | 2013-02-26 12:19:09 -0500 |
commit | 2bbc3d5860b81e128cd92f865673e10046caac7d (patch) | |
tree | 3816e3bf5e9e284e4f757cbc8856931ba516839e /src | |
parent | 31478b90128a60585c087bee57d31148677a99cd (diff) | |
download | jquery-2bbc3d5860b81e128cd92f865673e10046caac7d.tar.gz jquery-2bbc3d5860b81e128cd92f865673e10046caac7d.zip |
Fix #13471. $().on(".xyz"...) should avoid later crash.
If the event type is an empty string we end up hanging in .off() which makes for
mighty hard debugging. Instead treat it as a no-op. Docs seem clear this is not
allowed.
Diffstat (limited to 'src')
-rw-r--r-- | src/event.js | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/event.js b/src/event.js index 4266a1ddb..8a52c60ea 100644 --- a/src/event.js +++ b/src/event.js @@ -66,6 +66,11 @@ jQuery.event = { tmp = rtypenamespace.exec( types[t] ) || []; type = origType = tmp[1]; namespaces = ( tmp[2] || "" ).split( "." ).sort(); + + // There *must* be a type, no attaching namespace-only handlers + if ( !type ) { + continue; + } // If event changes its type, use the special event handlers for the changed type special = jQuery.event.special[ type ] || {}; |