SwVitaliy

solution

May 11th, 2012
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. count = 0
  2. >0
  3. B.prototype.init = function(){ if (++count < 100) console.log('B.prototype.init.apply', this);
  4.  
  5. if (arguments.callee === this.constructor.super.init) {  console.log('stop!!!'); return;  }
  6. this.constructor.super.init.apply(this,arguments);
  7.  
  8. this.extra = 'im B';
  9.  
  10.  
  11.  
  12. }
  13. >function (){ if (++count < 100) console.log('B.prototype.init.apply', this);
  14. >
  15. >if (arguments.callee === this.constructor.super.init) {  console.log('stop!!!'); return;  }
  16. >this.constructor.super.init.apply(this,arguments);
  17. >
  18. >this.extra = 'im B';
  19. >
  20. >
  21. >
  22. >}
  23. (new C).init();
  24. >C.prototype.init.apply
  25. >C
  26. >B.prototype.init.apply
  27. >C
  28. >stop!!!
Advertisement
Add Comment
Please, Sign In to add comment