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 ] || {};
jQuery("#firstp").trigger("custom");
});
+test("namespace-only event binding is a no-op", function(){
+ expect(2);
+
+ jQuery("#firstp")
+ .on( ".whoops", function() {
+ ok( false, "called a namespace-only event" );
+ })
+ .on( "whoops", function() {
+ ok( true, "called whoops" );
+ })
+ .trigger("whoops") // 1
+ .off(".whoops")
+ .trigger("whoops") // 2
+ .off("whoops");
+});
+
test("bind(), with same function", function() {
expect(2);