This is the JavaScript code generated by CoffeeScript’s extends keyword. How the prototype chain gets setup?
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;
};
See http://js-bits.blogspot.com/2010/08/javascript-inheritance-done-right.html (my own blog post)