Deep extend broken?
Deep extend broken?
Using deep $.extend() clobbers my source objects. Example:
var target = {};
var s1 = { will:{name:"Will Moffat"} };
var s2 = { will:{age:29} };
$.extend(/*deep*/true,target,s1,s2);
// OK: target = { will:{name:"Will Moffat", age:29} }
// FAIL: s1 = { will:{name:"Will Moffat", age:29} }
// OK: s2 not modified
s1 has been modified, it's now the same as target.
Is this a feature or a bug?
regards,
--Will