renamed tmp var in more explicative inh(erit)
[xynt.git] / prova.html
index bfd3f7d..ccac74a 100644 (file)
@@ -127,6 +127,11 @@ Summo.prototype = {
     name: "Summo",
     s_attr: null,
 
+    c_func: function()
+    {
+         console.log("c_func overwrited");
+    },
+
     s_func: function()
     {
          this.a_func();
@@ -143,7 +148,7 @@ function Extends(sub)
     var supers = [];
 
     thinF = function(){};
-    tmp = new thinF();
+    inh = new thinF();
 
     console.log("INIZIO EXT");
 
@@ -153,7 +158,7 @@ function Extends(sub)
 
         for (var f in proto) {
             console.log("LOOP: "+f);
-            if( f != "constructor" && typeof(proto[f]) == "function" && is_last){
+            if( f != "constructor" && typeof(proto[f]) == "function" && !is_last){
                 console.log("PR: "+proto['name']+"  F: "+f);
                 // sub[f] = proto[f];
                 sub[f] = function(){
@@ -170,11 +175,11 @@ function Extends(sub)
 
     for( var i=1; i < arguments.length ; i++){
         console.log("INIZIO LOOP");
-        multi(tmp, arguments[i], false);
+        multi(inh, arguments[i], false);
         supers.push(arguments[i].prototype);
     }
-    multi(tmp, sub, true);
-    sub.prototype = tmp;
+    multi(inh, sub, true);
+    sub.prototype = inh;
 }
 
 s_ist = new Summo();