Commit 69f72761 authored by Ariel Flesler's avatar Ariel Flesler

jquery core: fixed deep extend of objects. Closes #1562 & #2820.

parent 831625c4
...@@ -579,8 +579,11 @@ jQuery.extend = jQuery.fn.extend = function() { ...@@ -579,8 +579,11 @@ jQuery.extend = jQuery.fn.extend = function() {
continue; continue;
// Recurse if we're merging object values // Recurse if we're merging object values
if ( deep && copy && typeof copy == "object" && src && !copy.nodeType ) if ( deep && copy && typeof copy == "object" && !copy.nodeType )
target[ name ] = jQuery.extend( deep, src, copy ); target[ name ] = jQuery.extend( deep,
// Never move original objects, clone them
src || ( copy.length != null ? [ ] : { } )
, copy );
// Don't bring in undefined values // Don't bring in undefined values
else if ( copy !== undefined ) else if ( copy !== undefined )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment