public
Created

  • Download Gist
classes.js
JavaScript
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
var Bar, Foo, bar;
var __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, parent) {
for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; }
function ctor() { this.constructor = child; }
ctor.prototype = parent.prototype;
child.prototype = new ctor;
child.__super__ = parent.prototype;
return child;
};
Foo = (function() {
function Foo() {}
Foo.prototype.word = function() {
return 'foo';
};
Foo.prototype.say = function() {
return alert(word());
};
return Foo;
})();
Bar = (function() {
__extends(Bar, Foo);
function Bar() {
Bar.__super__.constructor.apply(this, arguments);
}
Bar.prototype.word = function() {
return 'bar';
};
return Bar;
})();
bar = new Bar();
bar.say();

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.