私は LiveScript (1.1.1) でこのコードを持っています:
class A
b = -> { a: 1 b: 2 }
これは次のようにコンパイルされます。
var A;
A = (function(){
A.displayName = 'A';
var b, prototype = A.prototype, constructor = A;
b = function(){
return prototype.a = 1, prototype.b = 2, prototype;
};
function A(){}
return A;
}());
b() がプロトタイプを変更するのはなぜですか? { a: 1, b: 2 }
連想配列を返すだけだと思っていました。