SHOW:
|
|
- or go back to the newest paste.
| 1 | - | function T(){ this.all.push(this) } |
| 1 | + | function T(){ this.all.push(this) }
|
| 2 | - | >undefined |
| 2 | + | >undefined |
| 3 | - | T.prototype.all =[]; |
| 3 | + | T.prototype.all =[]; |
| 4 | - | >[] |
| 4 | + | >[] |
| 5 | - | Utils.extend |
| 5 | + | Utils.extend |
| 6 | - | >function extend(Child, Parent) |
| 6 | + | >function extend(Child, Parent) |
| 7 | - | { |
| 7 | + | {
|
| 8 | - | var F = function() { }; |
| 8 | + | var F = function() { };
|
| 9 | - | F.prototype = Parent.prototype; |
| 9 | + | F.prototype = Parent.prototype; |
| 10 | - | Child.prototype = new F(); |
| 10 | + | Child.prototype = new F(); |
| 11 | - | Child.prototype.constructor = Child; |
| 11 | + | Child.prototype.constructor = Child; |
| 12 | - | Child.superclass = Parent.prototype; |
| 12 | + | Child.superclass = Parent.prototype; |
| 13 | - | } |
| 13 | + | } |
| 14 | - | |
| 14 | + | |
| 15 | - | function T1() { arguments.callee.superclass.constructor.apply(this, []) } |
| 15 | + | function T1() { arguments.callee.superclass.constructor.apply(this, []) }
|
| 16 | - | >undefined |
| 16 | + | >undefined |
| 17 | - | Utils.extend(T1, T); |
| 17 | + | Utils.extend(T1, T); |
| 18 | - | >undefined |
| 18 | + | >undefined |
| 19 | - | new T1 |
| 19 | + | new T1 |
| 20 | - | >T1 |
| 20 | + | >T1 |
| 21 | - | new T1 |
| 21 | + | new T1 |
| 22 | - | >T1 |
| 22 | + | >T1 |
| 23 | - | T.prototype.all |
| 23 | + | T.prototype.all |
| 24 | - | >[ |
| 24 | + | >[ |
| 25 | - | T1 |
| 25 | + | T1 |
| 26 | - | , |
| 26 | + | , |
| 27 | - | T1 |
| 27 | + | T1 |
| 28 | ] | |
| 29 | function T2() { console.log(arguments.callee.superclass.constructor) }
| |
| 30 | >undefined | |
| 31 | Utils.extend(T2, T1); | |
| 32 | >undefined | |
| 33 | new T2 | |
| 34 | >function T1() { arguments.callee.superclass.constructor.apply(this, []) }
| |
| 35 | >T2 | |
| 36 | function T2() { arguments.callee.superclass.constructor.apply(this, []) }
| |
| 37 | >undefined | |
| 38 | Utils.extend(T2, T1); | |
| 39 | >undefined | |
| 40 | new T2 | |
| 41 | >T2 | |
| 42 | T.prototype.all | |
| 43 | >[ | |
| 44 | T1 | |
| 45 | , | |
| 46 | T1 | |
| 47 | , | |
| 48 | T2 | |
| 49 | ] |