mirror of
https://github.com/jquery/jquery.git
synced 2024-11-23 02:54:22 +00:00
Event: Empty namespaces should be uneventfully ignored
Thanks @hamishdickson for the report!
Closes gh-1769
(cherry picked from commit 8653068dd6
)
This commit is contained in:
parent
1ece10fbee
commit
51564bbd39
@ -14,7 +14,7 @@ var rformElems = /^(?:input|select|textarea)$/i,
|
||||
rkeyEvent = /^key/,
|
||||
rmouseEvent = /^(?:mouse|pointer|contextmenu)|click/,
|
||||
rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
|
||||
rtypenamespace = /^([^.]*)(?:\.(.+)|)$/;
|
||||
rtypenamespace = /^([^.]*)(?:\.(.+)|)/;
|
||||
|
||||
function returnTrue() {
|
||||
return true;
|
||||
|
@ -587,6 +587,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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user