/**
 * Extend a class on a given base class.
 *
 * @param {Object} baseClass to extend from
 * @addon
 */
Function.prototype.extend = function(baseClass) {
    var inherit = function () {};
    inherit.prototype = baseClass.prototype;

    var subPrototype = this.prototype;

    this.prototype = new inherit();
    this.prototype.constructor = this;

    for(var member in subPrototype) {
        this.prototype[member] = subPrototype[member];
    }
};
