diff options
author | Dave Methvin <dave.methvin@gmail.com> | 2011-08-01 22:30:11 -0400 |
---|---|---|
committer | timmywil <timmywillisn@gmail.com> | 2011-09-19 15:42:31 -0400 |
commit | d74c6bd0f40f315ee12b411a8a5766596095d439 (patch) | |
tree | 602dd2d9e54df40605d7304cda94fee6306dde64 /src | |
parent | 03f99ff995ff2c55f995f08cde93b08e25f19f4c (diff) | |
download | jquery-d74c6bd0f40f315ee12b411a8a5766596095d439.tar.gz jquery-d74c6bd0f40f315ee12b411a8a5766596095d439.zip |
Add unit tests for quickIs cases and fix the regexp as a result.
Diffstat (limited to 'src')
-rw-r--r-- | src/event.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/event.js b/src/event.js index 873a6ddcb..cc85ec56a 100644 --- a/src/event.js +++ b/src/event.js @@ -7,7 +7,7 @@ var rnamespaces = /\.(.*)$/, rescape = /[^\w\s.|`]/g, rtypenamespace = /^([^\.]*)?(?:\.(.+))?$/, rhoverHack = /\bhover(\.\S+)?/, - rquickIs = /^([\w\-]+)?(?:#([\w\-]+))?(?:\.([\w\-]+))?(?:\[([\w+\-]+)=["']?([\w\-]*)["']?\])(:first-child|:last-child|:empty)?$/, + rquickIs = /^([\w\-]+)?(?:#([\w\-]+))?(?:\.([\w\-]+))?(?:\[([\w+\-]+)=["']?([\w\-]*)["']?\])?(:first-child|:last-child|:empty)?$/, delegateTypeMap = { focus: "focusin", blur: "focusout", @@ -69,12 +69,12 @@ jQuery.event = { // Handle multiple events separated by a space // jQuery(...).bind("mouseover mouseout", fn); - types = types.replace( rhoverHack, "mouseover$1 mouseout$1" ).split(" "); + types = types.replace( rhoverHack, "mouseover$1 mouseout$1" ).split( " " ); for ( t = 0; t < types.length; t++ ) { tns = rtypenamespace.exec( types[t] ) || []; type = tns[1]; - namespaces = (tns[2] || "").split(".").sort(); + namespaces = (tns[2] || "").split( "." ).sort(); handleObj = jQuery.extend({ type: type, data: data, @@ -112,7 +112,7 @@ jQuery.event = { } // Pre-analyze selector so we can process it quickly on event dispatch - quick = handleObj.quick = rquickIs.exec(selector); + quick = handleObj.quick = rquickIs.exec( selector ); if ( quick ) { // 0 1 2 3 4 5 6 // [ _, tag, id, class, attrName, attrValue, pseudo(:empty :first-child :last-child) ] |