That's not exactly true, the docs say under $merge:
"This method has been deprecated. Please use Object.merge instead."
Like I'm going to open the compat script and to decide if they are supposed to
be the same.
The blog post also said: "In order to reduce the number of global variables, we
ha
No where does it say that $merge == Object.merge
In fact, if you look in the compat script, it's obvious they are meant to be
different.
On Tue, Oct 12, 2010 at 2:46 PM, Perrin Perrin wrote:
> From 1.2 docs:
>
> var obj1 = {a: 0, b: 1};
> var obj2 = {c: 2, d: 3};
> var obj3 = {a: 4, d: 5};
> va
>From 1.2 docs:
var obj1 = {a: 0, b: 1};
var obj2 = {c: 2, d: 3};
var obj3 = {a: 4, d: 5};
var merged = $merge(obj1, obj2, obj3); //returns {a: 4, b: 1, c: 2, d:
5}, (obj1, obj2, and obj3 are unaltered)
var nestedObj1 = {a: {b: 1, c: 1}};
var nestedObj2 = {a: {b: 2}};
var nested = $merge(nestedOb
From the 1.3 docs:
var obj1 = {a: 0, b: 1};
var obj2 = {c: 2, d: 3};
var obj3 = {a: 4, d: 5};
var merged = Object.merge(obj1, obj2, obj3); // returns {a: 4, b: 1, c: 2, d:
5}, (obj2, and obj3 are unaltered)
merged === obj1; // true, obj1 gets altered and returned as merged object
var nestedObj1
Ouch.
Yes, this should not happen.
Can you post a ticket on lighthouse?
On 2010-10-12, at 23:32, atom wrote:
> bit of unexpected behavior (which might be intentional). When using
> Object.merge the objects I pass in are being altered, unlike how
> $merge used to behave.
>
> old way:
>
> var
bit of unexpected behavior (which might be intentional). When using
Object.merge the objects I pass in are being altered, unlike how
$merge used to behave.
old way:
var obj1 = {a: 1, b: 2, c: 3}
var obj2 = {d: 4, e: 5, f: 6}
var merged = $merge(obj1, obj2);
console.log(obj1); // returns {a: 1, b