If I have:
Object._extends = function(Derived, Base)
{
Derived.prototype = new Base();
Derived.prototype.constructor = Derived;
Derived.uber = Derived.prototype;
}
var BASE = function()
{
this._name = "BASE"
}
var DERIVED = function()
{
Object._extends(DERIVED, BASE)
this._age = 3;
}
// Object._extends(DERIVED, BASE) if I write here all is ok!!!
alert(new DERIVED()._name) // undefined!
when I write Object._extends(DERIVED, BASE)
into DERIVED
function then _name
is undefined but if I write the same function out then it is not undefined but why?