@@ -553,16 +553,20 @@ test("jQuery.extend(Object, Object)", function() {
553553 same ( empty . foo , optionsWithDate . foo , "Dates copy correctly" ) ;
554554
555555 var myKlass = function ( ) { } ;
556- var optionsWithCustomObject = { foo : { date : new myKlass } } ;
556+ var customObject = new myKlass ( ) ;
557+ var optionsWithCustomObject = { foo : { date : new customObject } } ;
557558 empty = { } ;
558559 jQuery . extend ( true , empty , optionsWithCustomObject ) ;
559- same ( empty . foo , optionsWithCustomObject . foo , "Custom objects copy correctly (no methods)" ) ;
560+ ok ( empty . foo && empty . foo . date && empty . foo . date === customObject , "Custom objects copy correctly (no methods)" ) ;
560561
561562 // Makes the class a little more realistic
562563 myKlass . prototype = { someMethod : function ( ) { } } ;
563564 empty = { } ;
564565 jQuery . extend ( true , empty , optionsWithCustomObject ) ;
565- same ( empty . foo , optionsWithCustomObject . foo , "Custom objects copy correctly" ) ;
566+ ok ( empty . foo && empty . foo . date && empty . foo . date === customObject , "Custom objects copy correctly" ) ;
567+
568+ var ret = jQuery . extend ( true , { foo : 4 } , { foo : new Number ( 5 ) } ) ;
569+ ok ( ret . foo == 5 , "Wrapped numbers copy correctly" ) ;
566570
567571 var nullUndef ;
568572 nullUndef = jQuery . extend ( { } , options , { xnumber2 : null } ) ;
0 commit comments