2014-07-13 01:04:16 +02:00
|
|
|
//// [instanceMemberAssignsToClassPrototype.ts]
|
|
|
|
class C {
|
|
|
|
foo() {
|
|
|
|
C.prototype.foo = () => { }
|
|
|
|
}
|
|
|
|
|
|
|
|
bar(x: number): number {
|
|
|
|
C.prototype.bar = () => { } // error
|
|
|
|
C.prototype.bar = (x) => x; // ok
|
|
|
|
C.prototype.bar = (x: number) => 1; // ok
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//// [instanceMemberAssignsToClassPrototype.js]
|
|
|
|
var C = (function () {
|
|
|
|
function C() {
|
|
|
|
}
|
|
|
|
C.prototype.foo = function () {
|
2015-02-07 03:45:09 +01:00
|
|
|
C.prototype.foo = function () { };
|
2014-07-13 01:04:16 +02:00
|
|
|
};
|
|
|
|
C.prototype.bar = function (x) {
|
2015-02-07 03:45:09 +01:00
|
|
|
C.prototype.bar = function () { }; // error
|
2014-08-16 00:49:09 +02:00
|
|
|
C.prototype.bar = function (x) { return x; }; // ok
|
|
|
|
C.prototype.bar = function (x) { return 1; }; // ok
|
2014-07-13 01:04:16 +02:00
|
|
|
return 1;
|
|
|
|
};
|
|
|
|
return C;
|
|
|
|
})();
|