SHOW:
|
|
- or go back to the newest paste.
1 | var Base = function(target){ | |
2 | this.__proto__ = target; | |
3 | this.draw = function(){console.log("Base.draw",this);} | |
4 | this.baseFn = function(){console.log("Base.baseFn",this);} | |
5 | this.baseOR = function(){console.log("Base.baseOR",this);} | |
6 | this.baseCallWater = function(){console.log("Base.baseCallWater",this.waterFn(),this);} | |
7 | } | |
8 | var Fluid = function(target){ | |
9 | this.__proto__ = new Base(target) | |
10 | this.draw = function(){console.log("Fluid.draw",this);} | |
11 | this.fluidFn = function(){console.log("Fluid.fluidFn",this);} | |
12 | this.fluidOR = function(){console.log("Fluid.fluidOR",this);} | |
13 | this.baseOR = function(){console.log("Fluid.baseOR",this);} | |
14 | - | this.fluidCallWater = function(){console.log("Fluid.fluidCallWater",this.waterFn(),this);} |
14 | + | this.fluidCallWater = function(){ |
15 | console.log("Fluid.fluidCallWater",this.waterFn(),this); | |
16 | } | |
17 | } | |
18 | var Water = function(target){ | |
19 | - | this.waterFn = function(){console.log("Water.waterFn",this);} |
19 | + | |
20 | this.draw = function(){console.log("Water.draw",this);} | |
21 | this.waterFn = function(){var r = "Water.waterFn";console.log(r,this);return r;} | |
22 | this.fluidOR = function(){console.log("Water.fluidOR",this);} | |
23 | } | |
24 | - | w.draw(); |
24 | + | |
25 | - | w.baseFn(); |
25 | + | |
26 | - | w.fluidFn(); |
26 | + | w.draw(); // Water.draw [div] |
27 | - | w.waterFn(); |
27 | + | w.baseFn(); // Base.baseFn [div] |
28 | - | w.baseOR(); |
28 | + | w.fluidFn(); // Fluid.fluidFn [div] |
29 | - | w.fluidOR(); |
29 | + | w.waterFn(); // Water.waterFn [div] |
30 | - | w.fluidCallWater(); |
30 | + | w.baseOR(); // Fluid.baseOR [div] |
31 | - | w.baseCallWater(); |
31 | + | w.fluidOR(); // Water.fluidOR [div] |
32 | w.fluidCallWater(); // Water.waterFn [div] Fluid.fluidCallWater Water.waterFn [div] | |
33 | w.baseCallWater(); // Water.waterFn [div] Base.baseCallWater Water.waterFn [div] |