Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function Base(){}
- >undefined
- Base.prototype.init = function() {
- this.a='1';
- }
- >function () {
- >this.a='1';
- >
- >}
- Base.prototype.create = function(config) {
- this.init(config);
- return this;
- }
- >function (config) {
- >this.init(config);
- >return this;
- >}
- function Child(){}
- >undefined
- extend = function(Child, Parent)
- {
- var F = function() { };
- F.prototype = Parent.prototype;
- Child.prototype = new F();
- Child.prototype.constructor = Child;
- Child.super = Parent.prototype;
- };
- >function (Child, Parent)
- > {
- > var F = function() { };
- > F.prototype = Parent.prototype;
- > Child.prototype = new F();
- > Child.prototype.constructor = Child;
- > Child.super = Parent.prototype;
- > }
- extend(Child, Base)
- >undefined
- >Child.prototype
- F
- Child.super
- >Base
- function Child2(){}
- >undefined
- extend(Child2, Child)
- >undefined
- Child2
- >function Child2(){}
- Child2.super
- >F
- >constructor: function Child(){}
- >__proto__: Base
Advertisement
Add Comment
Please, Sign In to add comment