]> source.dussan.org Git - jquery.git/commitdiff
Make cached rspaces regex definitions consistent. Fixes #9008
authorrwldrn <waldron.rick@gmail.com>
Thu, 28 Apr 2011 18:11:34 +0000 (14:11 -0400)
committertimmywil <tim.willison@thisismedium.com>
Thu, 28 Apr 2011 20:06:13 +0000 (16:06 -0400)
src/ajax.js
src/event.js

index a16717b00add23875f256b3d189e6bf51625ac73..2d048479ce9c8d89818dd6ee27dbccbc5e818d67 100644 (file)
@@ -13,7 +13,7 @@ var r20 = /%20/g,
        rquery = /\?/,
        rscript = /<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,
        rselectTextarea = /^(?:select|textarea)/i,
-       rspacesAjax = /\s+/,
+       rspaces = /\s+/,
        rts = /([?&])_=[^&]*/,
        rurl = /^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,
 
@@ -71,7 +71,7 @@ function addToPrefiltersOrTransports( structure ) {
                }
 
                if ( jQuery.isFunction( func ) ) {
-                       var dataTypes = dataTypeExpression.toLowerCase().split( rspacesAjax ),
+                       var dataTypes = dataTypeExpression.toLowerCase().split( rspaces ),
                                i = 0,
                                length = dataTypes.length,
                                dataType,
@@ -599,7 +599,7 @@ jQuery.extend({
                s.url = ( ( url || s.url ) + "" ).replace( rhash, "" ).replace( rprotocol, ajaxLocParts[ 1 ] + "//" );
 
                // Extract dataTypes list
-               s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().split( rspacesAjax );
+               s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().split( rspaces );
 
                // Determine if a cross-domain request is in order
                if ( s.crossDomain == null ) {
index 0f09241c9810eda14f29fbb9686d234b9da44840..09ea02e75bf6afed98c61118512a25296361bdcd 100644 (file)
@@ -4,7 +4,7 @@ var hasOwn = Object.prototype.hasOwnProperty,
        rnamespaces = /\.(.*)$/,
        rformElems = /^(?:textarea|input|select)$/i,
        rperiod = /\./g,
-       rspace = / /g,
+       rspaces = /\s+/,
        rescape = /[^\w\s.|`]/g,
        fcleanup = function( nm ) {
                return nm.replace(rescape, "\\$&");
@@ -1177,7 +1177,7 @@ function liveHandler( event ) {
 }
 
 function liveConvert( type, selector ) {
-       return (type && type !== "*" ? type + "." : "") + selector.replace(rperiod, "`").replace(rspace, "&");
+       return (type && type !== "*" ? type + "." : "") + selector.replace(rperiod, "`").replace(rspaces, "&");
 }
 
 jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " +