Commit ca367674 authored by Rick Waldron's avatar Rick Waldron

Restored /g flag to rspaces; Adds unit tests; Supplements #9008

parent e5f4ec84
...@@ -4,7 +4,7 @@ var hasOwn = Object.prototype.hasOwnProperty, ...@@ -4,7 +4,7 @@ var hasOwn = Object.prototype.hasOwnProperty,
rnamespaces = /\.(.*)$/, rnamespaces = /\.(.*)$/,
rformElems = /^(?:textarea|input|select)$/i, rformElems = /^(?:textarea|input|select)$/i,
rperiod = /\./g, rperiod = /\./g,
rspaces = /\s+/, rspaces = /\s+/g,
rescape = /[^\w\s.|`]/g, rescape = /[^\w\s.|`]/g,
fcleanup = function( nm ) { fcleanup = function( nm ) {
return nm.replace(rescape, "\\$&"); return nm.replace(rescape, "\\$&");
......
...@@ -68,6 +68,22 @@ test("bind(), multiple events at once", function() { ...@@ -68,6 +68,22 @@ test("bind(), multiple events at once", function() {
equals( mouseoverCounter, 1, "bind() with multiple events at once" ); equals( mouseoverCounter, 1, "bind() with multiple events at once" );
}); });
test("bind(), five events at once", function() {
expect(1);
var count = 0,
handler = function(event) {
count++;
};
jQuery("#firstp").bind("click mouseover foo bar baz", handler)
.trigger("click").trigger("mouseover")
.trigger("foo").trigger("bar")
.trigger("baz");
equals( count, 5, "bind() five events at once" );
});
test("bind(), multiple events at once and namespaces", function() { test("bind(), multiple events at once and namespaces", function() {
expect(7); expect(7);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment