diff --git a/src/event.js b/src/event.js index 44961ef7d..0dd44e244 100644 --- a/src/event.js +++ b/src/event.js @@ -15,7 +15,7 @@ var rkeyEvent = /^key/, rmouseEvent = /^(?:mouse|pointer|contextmenu)|click/, rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, - rtypenamespace = /^([^.]*)(?:\.(.+)|)$/; + rtypenamespace = /^([^.]*)(?:\.(.+)|)/; function returnTrue() { return true; diff --git a/test/unit/event.js b/test/unit/event.js index 7e2bc26b6..8e33c6b90 100644 --- a/test/unit/event.js +++ b/test/unit/event.js @@ -583,6 +583,17 @@ test("namespace-only event binding is a no-op", function(){ .off("whoops"); }); +test("Empty namespace is ignored", function(){ + expect( 1 ); + + jQuery("#firstp") + .on( "meow.", function( e ) { + equal( e.namespace, "", "triggered a namespace-less meow event" ); + }) + .trigger("meow.") + .off("meow."); +}); + test("on(), with same function", function() { expect(2);