Remove unneeded parens in $.compareObject; Fix addCSS QUnit test for IE6 which puts...
authorKrinkle <krinkle@users.mediawiki.org>
Thu, 12 May 2011 23:03:16 +0000 (23:03 +0000)
committerKrinkle <krinkle@users.mediawiki.org>
Thu, 12 May 2011 23:03:16 +0000 (23:03 +0000)
resources/mediawiki/mediawiki.js
resources/test/unit/mediawiki.util/mediawiki.util.js

index 68d860a..3ceafc2 100644 (file)
@@ -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' :
index b5be0b3..2943369 100644 (file)
@@ -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.' );
+       
 
 });