event.remove/handle() bug with namespaced events?

event.remove/handle() bug with namespaced events?


I suppose it is rear to use multiple namespaces to unbind an event and
that it is the reason why no one spotted this bug (I spotted it by
examining code, not by using the feature).
This is the problem:
$("div").bind("click.aaa.bbb", function(){...});
$("div").unbind("click.a.bbb"); //this is unbinding the previous
bind!!!
Now someone would suppose: "Well it seams fine, there is .bbb so it
will unbind click.aaa.bbb too", but it is not true:
$("div").unbind("click.bbb.other") // will not unbind click.aaa.bbb
The problem seams to be the generated regexp into event.remove() and
event.handle():
var namespace = RegExp("(^|\\.)" + namespaces.slice().sort().join(".*\
\.") + "(\\.|$)");
that for me would be:
var namespace = RegExp("(^|\\.)" + namespaces.slice().sort().join("\\.
(?:.*\\.)?") + "(\\.|$)");
Am I missing something here?
Here is a test-case http://jsbin.com/aledo
And here is the same case with the corrected event.remove() function:
http://jsbin.com/eqofo
(I hope jsbin.com has no problems any more)
Will I open a ticket?