次のコード スニペットを変換しようとすると ...
result.pause = function() {
cachedValue = this();
isPaused(true);
}.bind(result);
http://js2coffee.org/を使用すると返されます
result.pause = ->
cachedValue = this()
isPaused true
.bind(result)
ただし、そのコードをコンパイルしようとすると、Error Unexpected '.' が返されます。
この状況で CoffeeScript を使用して .bind 関数を使用する正しい方法は何でしょうか?