14 console.log("INIZIO EXT");
16 var multi = function(sub, super, is_last)
18 var proto = super.prototype;
20 for (var f in proto) {
21 if (f == "xynt_sup" || f == "xynt_sup_cl")
24 console.log("LOOP: "+f);
25 if( f != "constructor" && typeof(proto[f]) == "function" && !is_last){
26 console.log("M_FU: "+proto['name']+" F: "+f);
29 console.log("INFU PR: " + proto['name'] + " FUNC: "+f+" THIS: " + this);
30 return proto[f].apply(this,arguments);
34 console.log("M_PR: "+proto.name+" A: "+f+" FUN: "+proto[f]);
40 for( var i=1; i < arguments.length ; i++){
41 multi(inh, arguments[i], false);
42 inh.xynt_sup.push(arguments[i].prototype);
43 inh.xynt_sup_cl.push(arguments[i]);
46 multi(inh, sub, true);
49 inh.callSuper = function(fnc){
50 var len = this.xynt_sup_cl.length;
51 for ( var i=0 ; i<len ; i++) {
52 var super = this.xynt_sup_cl[i];
53 if( (fnc in super.prototype) && (typeof super.prototype[fnc] == "function") ){
54 return super.prototype[fnc].apply(this,[].splice.call(arguments,1));
61 inh.superrr = function(cl, method) {
62 console.log("xyx "+cl);
63 // console.log("xx"+arguments[0]);
64 // return this.xynt_sup_cl[cl].method.apply(this,arguments.slice(2));
69 console.log(sub.prototype.xynt_sup);
70 console.log(sub.prototype.xynt_sup_cl);
73 function ExtendsInst(sub)
77 console.log("INIZIO EXT INST");
79 var multi = function(sub, super, is_last)
81 var proto = super.prototype;
83 if (typeof(sub.xynt_sup) == 'undefined')
84 sub.xynt_sup = new Array();
85 if (typeof(sub.xynt_sup_cl) == 'undefined')
86 sub.xynt_sup_cl = new Array();
88 for (var f in proto) {
89 if (f == "xynt_sup" || f == "xynt_sup_cl")
92 console.log("ExtensInst::multi: "+f+" type: "+typeof(sub[f]));
93 if (typeof(sub[f]) != 'undefined') {
94 if (typeof(sub[f]) == typeof(proto[f]))
96 console.log("MULTI: false1");
100 console.log("LOOP: "+f);
101 if( f != "constructor" && typeof(proto[f]) == "function" && !is_last){
102 console.log("M_FU: "+proto['name']+" F: "+f);
104 console.log("INFU PR: " + proto[f] + " FUNC: "+f+" THIS: " + this);
105 return proto[f].apply(this, arguments);
109 console.log("M_PR: "+proto.name+" A: "+f+" FUN: "+proto[f]);
116 console.log("POST FUNC");
118 for( var i=1; i < arguments.length ; i++){
119 console.log("POST FUNC IN LOOP");
121 if (i+1 < arguments.length && typeof(arguments[i+1]) != 'function') {
125 if (multi(sub, cl, false) == false) {
126 console.log("POST FUNC FALSE 1");
130 console.log("POST FUNC PRE APPLY");
132 console.log("POST FUNC POST APPLY");
134 sub.xynt_sup.push(cl.prototype);
135 sub.xynt_sup_cl.push(cl);
138 sub.callSuper = function(fnc){
139 var len = this.xynt_sup_cl.length;
140 for ( var i=0 ; i<len ; i++) {
141 var super = this.xynt_sup_cl[i];
142 if( (fnc in super.prototype) && (typeof super.prototype[fnc] == "function") ){
143 return super.prototype[fnc].apply(this,[].splice.call(arguments,1));
149 console.log("FINE EXT INST");
153 function show_class(cl) {
154 console.log("Attributes Class of "+cl);
155 for (f in cl.prototype) {
156 console.log(f+": ["+cl.prototype[f]+"]");
161 function show_inst(inst) {
162 console.log("Attributes Instance of "+inst);
164 console.log("["+f+"]: ["+inst[f]+"]");