Created
September 2, 2011 20:39
-
-
Save AlexJWayne/1189853 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment