Skip to content
Permalink
Browse files
jquery core: fixed deep extend of objects. Closes #1562 & #2820.
  • Loading branch information
flesler committed May 14, 2008
1 parent 831625c commit 69f7276
Showing 1 changed file with 5 additions and 2 deletions.
@@ -579,8 +579,11 @@ jQuery.extend = jQuery.fn.extend = function() {
continue;

// Recurse if we're merging object values
if ( deep && copy && typeof copy == "object" && src && !copy.nodeType )
target[ name ] = jQuery.extend( deep, src, copy );
if ( deep && copy && typeof copy == "object" && !copy.nodeType )
target[ name ] = jQuery.extend( deep,
// Never move original objects, clone them
src || ( copy.length != null ? [ ] : { } )
, copy );

// Don't bring in undefined values
else if ( copy !== undefined )

0 comments on commit 69f7276

Please sign in to comment.