From: Krinkle Date: Thu, 12 May 2011 23:03:16 +0000 (+0000) Subject: Remove unneeded parens in $.compareObject; Fix addCSS QUnit test for IE6 which puts... X-Git-Tag: 1.31.0-rc.0~30267 X-Git-Url: http://git.cyclocoop.org/%28?a=commitdiff_plain;h=265bc325d2a2e6d94d67e2002e45f26e525a1a2a;p=lhc%2Fweb%2Fwiklou.git Remove unneeded parens in $.compareObject; Fix addCSS QUnit test for IE6 which puts spaces between commas.. --- diff --git a/resources/mediawiki/mediawiki.js b/resources/mediawiki/mediawiki.js index 68d860ae9c..3ceafc272a 100644 --- a/resources/mediawiki/mediawiki.js +++ b/resources/mediawiki/mediawiki.js @@ -57,10 +57,10 @@ jQuery.extend({ compareObject : function( objectA, objectB ) { // Do a simple check if the types match - if ( typeof( objectA ) == typeof( objectB ) ) { + if ( typeof objectA == typeof objectB ) { // Only loop over the contents if it really is an object - if ( typeof( objectA ) == 'object' ) { + if ( typeof objectA == 'object' ) { // If they are aliases of the same object (ie. mw and mediaWiki) return now if ( objectA === objectB ) { return true; @@ -71,8 +71,8 @@ jQuery.extend({ // Check if this property is also present in the other object if ( prop in objectB ) { // Compare the types of the properties - var type = typeof( objectA[prop] ); - if ( type == typeof( objectB[prop] ) ) { + var type = typeof objectA[prop]; + if ( type == typeof objectB[prop] ) { // Recursively check objects inside this one switch ( type ) { case 'object' : diff --git a/resources/test/unit/mediawiki.util/mediawiki.util.js b/resources/test/unit/mediawiki.util/mediawiki.util.js index b5be0b308e..2943369990 100644 --- a/resources/test/unit/mediawiki.util/mediawiki.util.js +++ b/resources/test/unit/mediawiki.util/mediawiki.util.js @@ -25,7 +25,9 @@ test( 'addCSS', function(){ same( a.disabled, false, 'property "disabled" is available and set to false' ); var $b = $('#bodyContent'); - equals( $b.css('background-color'), 'rgb(170, 255, 170)', 'Style color matches.' ); + var match = $b.css('background-color').match(/rgb\(170,\s*255,\s*170\)/); + ok( match && match.length === 1, 'Style color matches.' ); + });