Skip to content

Commit

Permalink
jquery core: fixed deep extend of objects. Closes jquery#1562 & jquer…
Browse files Browse the repository at this point in the history
  • Loading branch information
flesler committed May 14, 2008
1 parent 831625c commit 69f7276
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/core.js
Expand Up @@ -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 )
Expand Down

0 comments on commit 69f7276

Please sign in to comment.