Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var Base = function(target){
- this.__proto__ = target;
- this.draw = function(){console.log("Base.draw",this);}
- this.baseFn = function(){console.log("Base.baseFn",this);}
- this.baseOR = function(){console.log("Base.baseOR",this);}
- this.baseCallWater = function(){console.log("Base.baseCallWater",this.waterFn(),this);}
- }
- var Fluid = function(target){
- this.__proto__ = new Base(target)
- this.draw = function(){console.log("Fluid.draw",this);}
- this.fluidFn = function(){console.log("Fluid.fluidFn",this);}
- this.fluidOR = function(){console.log("Fluid.fluidOR",this);}
- this.baseOR = function(){console.log("Fluid.baseOR",this);}
- this.fluidCallWater = function(){console.log("Fluid.fluidCallWater",this.waterFn(),this);}
- }
- var Water = function(target){
- this.__proto__ = new Fluid(target)
- this.draw = function(){console.log("Water.draw",this);}
- this.waterFn = function(){console.log("Water.waterFn",this);}
- this.fluidOR = function(){console.log("Water.fluidOR",this);}
- }
- var w = new Water($("<div />"));
- w.draw();
- w.baseFn();
- w.fluidFn();
- w.waterFn();
- w.baseOR();
- w.fluidOR();
- w.fluidCallWater();
- w.baseCallWater();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement