SwVitaliy

Untitled

Apr 29th, 2012
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. function T(){ this.all.push(this) }
  2. >undefined
  3. T.prototype.all =[];
  4. >[]
  5. function T1() { console.log( arguments.callee.superclass ) }
  6. >undefined
  7. Utils.extend(T1, T);
  8. >undefined
  9. Utils.extend
  10. >function extend(Child, Parent)
  11. {
  12. var F = function() { };
  13. F.prototype = Parent.prototype;
  14. Child.prototype = new F();
  15. Child.prototype.constructor = Child;
  16. Child.superclass = Parent.prototype;
  17. }
  18. function T2(){ console.log( arguments.callee.superclass ) }
  19. >undefined
  20. Utils.extend(T2, T1);
  21. >undefined
  22. new T
  23. >T
  24. new T1
  25. >T
  26. >T1
  27. new T2
  28. >F
  29. >T2
Advertisement
Add Comment
Please, Sign In to add comment