次のCoffeescriptコードを実行すると:
@sum = (x, y) -> x + y
私はこのコンパイルされたJavascriptを取得します:
(function() {
this.sum = function(x, y) {
return x + y;
};
}).call(this);
Coffeescriptに何かのような任意のオブジェクトthis
に置き換える方法はありますか?.call(this)
myObject