I am doing OO javascript for the first time. I have read about inheritance and prototype and thought I had cracked it. Until I discovered this little example.
I think
TestObject2.prototype = new TestObject();
is overriding the constructor of TestObject2.
Try
function TestObject2(data)
{
TestObject.call( this, data);
this.__construct(data);
this.dothings = function()
{
this.dosomestuff();
}
}
TestObject2.prototype = new TestObject();
TestObject2.prototype.constructor = TestObject2;