I'm using JsTestDriver to test, and develop, something in Javascript.
I'm having, periodically, this kind of AssertError:
expected [object] but was {...}
Some other times, it could be:
expected [object] but was [object]
And finally, it can also be:
expected {x=1,...} but was {x=2,...}
So, I've concluded that [object] would be the 'instance' of the object I've created with the 'new' keyword. The collection, that represents each properties of the object could be a copied version of the original object.
If that so, does that mean that when I'm in a situation like this:
function() {
...
var obj1 = fctThatReturnsAnObject();
obj2.addChild(obj1);
...
};
since the obj1 is a variable inside the scope of the function, it would make a copy collection of the original object?
If that's the case, is there a way to get the object by reference and not make a collection copy of it?
Thanks!
P.S.: An extension to this question would be: how to change the '[object]' for some more useful information?