Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Can be found on http://keysle.thoughts.com in "Talk and Progress #1.2"
- I'll make a video about this later and explain why I'm using this structure @yt/keysle
- */
- function __(_){return _.constructor}
- //class
- var _ = ( CLASS = function(){
- this.variable = 0;
- this.sub = new CLASS.SUBCLASS();
- }).prototype;
- _.func = function(){
- alert('lvl'+this.variable);
- this.sub.func();
- }
- _.divePeak = function(){
- alert('lvl'+this.variable);
- this.sub.variable += 5;
- }
- //sub class
- _ = ( __(_).SUBCLASS = function(){
- this.variable = 1;
- this.sub = new CLASS.SUBCLASS.DEEPCLASS();
- }).prototype;
- _.func = function(){
- alert('lvl'+this.variable);
- this.sub.func();
- }
- //deep class
- _ = ( __(_).DEEPCLASS = function(){
- this.variable = 2;
- }).prototype;
- _.func = function(){
- alert('lvl'+this.variable);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement