A = function () { return B; }; A.prototype.custom = "OK"; B = function () {}; B.prototype = A.prototype; B = new B();