Closed AaronAcerboni closed 11 years ago
The deep flag in extend does not fully copy over all properties.
extend
Steps to reproduce:
var obj1 = { animal: "dog", about: { legs: 4 } }, obj2 = { name: "rex", about: { attitude: "friendly" } }; var merged = Pablo.extend(obj1, obj2, true); // Expected object: { animal: "dog", name: "rex", about: { legs: 4, attitude: "friendly" } } // Actual object: { animal: "dog", name: "rex", about: { attitude: "friendly" } }
It copies over properties in the prototype chain:
function Foo(){} Foo.prototype = {bar:1}; Pablo.extend({}, new Foo()); // {} Pablo.extend({}, new Foo(), true); // {bar:1}
committed 46d9746
The deep flag in
extend
does not fully copy over all properties.Steps to reproduce: