Initial contents of objects [as output by dumpObjects()]...
put dump here
Class(A);
function A()
{
this.konstructor = function(p1){ this.a = p1; }
this.sayHi = function(){ alert("Howdy!"); }
this.sayBye = function(){ alert("Bye!"); }
this.dumpvars = function(){ return " a="+this.a; }
this.dump = function(){ return "["+this.dumpvars()+" ]"; }
}
Class(B).Extends(A);
function B()
{
this.konstructor = function(p1,p2){ this.souper(p1); this.b = p2; }
this.dumpvars = function(){ return this.souper()+" b="+this.b; }
this.sayBye = function(){ alert("Aloha!"); }
}
Class(C).Extends(B);
function C()
{
this.konstructor = function(p1,p2,p3){ this.souper(p1,p2); this.c = p3; }
this.dumpvars = function(){ return this.souper()+" c="+this.c; }
this.sayHi = function(){ this.souper(); alert("Y'all"); }
}
Class(NotUsed);
function NotUsed(){ this.sayFool = function(){ alert("fool"); } }
var gA = new A(1);
var gB = new B(2,3);
var gC = new C(4,5,6);
function listInstanceOf( anObject ){
return "["
+ (anObject instanceof A ? "A" : " ")
+ (anObject instanceof B ? "B" : " ")
+ (anObject instanceof C ? "C" : " ")
+ (anObject instanceof NotUsed ? "Err1" : "")
+ (anObject instanceof dumpObjects ? "Err2" : "")
+ "]";
}
function dumpObjects(){
var s = "gA:"+listInstanceOf(gA)+ gA.dump() + "[br/]"
+ "gB:"+listInstanceOf(gB)+ gB.dump() + "[br/]"
+ "gC:"+listInstanceOf(gC)+ gC.dump() + "[br/]";
document.getElementById("OutputArea").innerHTML = s;
}