Remove unneeded parens in $.compareObject; Fix addCSS QUnit test for IE6 which puts spaces between commas..

This commit is contained in:
Krinkle 2011-05-12 23:03:16 +00:00
parent 23eb73a30a
commit 265bc325d2
2 changed files with 7 additions and 5 deletions

View 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' :

View 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.' );
});