extend deeper
extend deeper
Hi,
I've just discovered that $.extend(true, a, b) will extend a & b
"recursivly"
this is a nice feature, but why not extend really in a recurse way but
just with only 1 more level?
In Jquery 1.2.3 source @ line 597:
// Recurse if we're merging object values
if ( deep && options[ name ] && typeof options[ name ] == "object" &&
target[ name ] && !options[ name ].nodeType )
target[ name ] = jQuery.extend( target[ name ], options[ name ] );
-> this extends "recursivly" on the next level only
But this should be:
// Recurse if we're merging object values
if ( deep && options[ name ] && typeof options[ name ] == "object" &&
target[ name ] && !options[ name ].nodeType )
target[ name ] = jQuery.extend(true, target[ name ],
options[ name ] );
-> this is really recursive!
This could be considered as a bug... but as this feature is not
completly documented, i don't know how to handle it!