我不知道这有多有用,但如果你输入编译这个咖啡脚本:
class BaseView extends Backbone.View
class MyView extends Baseview
它生成:
(function() {
var BaseView, MyView,
__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; };
BaseView = (function(_super) {
__extends(BaseView, _super);
function BaseView() {
BaseView.__super__.constructor.apply(this, arguments);
}
return BaseView;
})(Backbone.View);
MyView = (function(_super) {
__extends(MyView, _super);
function MyView() {
MyView.__super__.constructor.apply(this, arguments);
}
return MyView;
})(Baseview);
}).call(this);