Skip to main content

Bug Tracker

Side navigation

Ticket #4113: test.patch
File test.patch, 4.1 KB (added by andr3a, February 12, 2009 04:06PM UTC)

patch via svn

Index: ajax.js
===================================================================
--- ajax.js	(revision 6193)
+++ ajax.js	(working copy)
@@ -186,15 +186,15 @@
 		// Handle JSONP Parameter Callbacks
 		if ( s.dataType == "jsonp" ) {
 			if ( type == "GET" ) {
-				if ( !s.url.match(jsre) )
-					s.url += (s.url.match(/\?/) ? "&" : "?") + (s.jsonp || "callback") + "=?";
-			} else if ( !s.data || !s.data.match(jsre) )
+				if ( !jsre.test(s.url) )
+					s.url += (/\?/.test(s.url) ? "&" : "?") + (s.jsonp || "callback") + "=?";
+			} else if ( !s.data || !jsre.test(s.data) )
 				s.data = (s.data ? s.data + "&" : "") + (s.jsonp || "callback") + "=?";
 			s.dataType = "json";
 		}
 
 		// Build temporary JSONP function
-		if ( s.dataType == "json" && (s.data && s.data.match(jsre) || s.url.match(jsre)) ) {
+		if ( s.dataType == "json" && (s.data && jsre.test(s.data) || jsre.test(s.url)) ) {
 			jsonp = "jsonp" + jsc++;
 
 			// Replace the =? sequence both in the query string and the data
@@ -227,12 +227,12 @@
 			// try replacing _= if it is there
 			var ret = s.url.replace(/(\?|&)_=.*?(&|$)/, "$1_=" + ts + "$2");
 			// if nothing was replaced, add timestamp to the end
-			s.url = ret + ((ret == s.url) ? (s.url.match(/\?/) ? "&" : "?") + "_=" + ts : "");
+			s.url = ret + ((ret == s.url) ? (/\?/.test(s.url) ? "&" : "?") + "_=" + ts : "");
 		}
 
 		// If data is available, append data to url for get requests
 		if ( s.data && type == "GET" ) {
-			s.url += (s.url.match(/\?/) ? "&" : "?") + s.data;
+			s.url += (/\?/.test(s.url) ? "&" : "?") + s.data;
 
 			// IE likes to send both get and post data, prevent this
 			s.data = null;
Index: core.js
===================================================================
--- core.js	(revision 6193)
+++ core.js	(working copy)
@@ -772,7 +772,7 @@
 		}
 
 		// Make sure we're using the right name for getting the float value
-		if ( name.match( /float/i ) )
+		if ( /float/i.test( name ) )
 			name = styleFloat;
 
 		if ( !force && style && style[ name ] )
@@ -781,7 +781,7 @@
 		else if ( defaultView.getComputedStyle ) {
 
 			// Only "float" is needed here
-			if ( name.match( /float/i ) )
+			if ( /float/i.test( name ) )
 				name = "float";
 
 			name = name.replace( /([A-Z])/g, "-$1" ).toLowerCase();
@@ -853,7 +853,7 @@
 			if ( typeof elem === "string" ) {
 				// Fix "XHTML"-style tags in all browsers
 				elem = elem.replace(/(<(\w+)[^>]*?)\/>/g, function(all, front, tag){
-					return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i) ?
+					return /^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i.test(tag) ?
 						all :
 						front + ">";
 				});
@@ -869,7 +869,7 @@
 					!tags.indexOf("", "" ] ||
 
-					tags.match(/^<(thead|tbody|tfoot|colg|cap)/) &&
+					/^<(thead|tbody|tfoot|colg|cap)/.test(tags) &&
 					[ 1, "", "
" ] || !tags.indexOf("

Download in other formats:

Original Format