11 console.log("a_func run");
24 console.log("b_func run");
35 console.log("c_func run");
41 function print_dynstat(inst, name)
43 for (i = 0 ; i < inst.length ; i++) {
44 console.log(name[i]+".a_dyn: "+inst[i].a_dyn);
45 console.log(name[i]+".a_stat: "+inst[i].a_stat);
49 window.onload = function () {
59 arr_inst = [ a1 , a2 , b1 , c1 ];
60 arr_name = [ "a1", "a2", "b1", "c1" ];
62 print_dynstat(arr_inst, arr_name);
65 console.log("ACTION: a1.a_stat = \"CHANGED\";");
66 a1.a_stat = "CHANGED";
68 print_dynstat(arr_inst, arr_name);
71 console.log("ACTION: A.prototype.a_stat = \"PROTO CHANGED\"");
72 A.prototype.a_stat = "PROTO CHANGED";
74 print_dynstat(arr_inst, arr_name);
77 console.log("ACTION: ExtendsInst(c1, A, [1, 33])");
79 var ext = ExtendsInst(c1, A, [1, 33]);
80 console.log("ExtInst: "+(ext == true ? "TRUE" : "FALSE"));
82 print_dynstat(arr_inst, arr_name);
85 console.log("ACTION: B.prototype.a_stat = \"PROTO CHANGED\"");
86 B.prototype.a_stat = "PROTO CHANGED";
88 print_dynstat(arr_inst, arr_name);
91 console.log("ACTION: C.prototype.a_stat = \"PROTO CHANGED\"");
92 C.prototype.a_stat = "PROTO CHANGED";
94 print_dynstat(arr_inst, arr_name);
96 console.log("=== INSTANCE c1 ===");
98 console.log("=== INSTANCE c1.a_func() ===");
100 console.log("=== INSTANCE c1.c_func() ===");