2015-02-03 00:15:54 +01:00
|
|
|
//// [staticGetterAndSetter.ts]
|
|
|
|
class Foo {
|
|
|
|
static get Foo():number { return 0; }
|
|
|
|
static set Foo(n: number) {}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//// [staticGetterAndSetter.js]
|
|
|
|
var Foo = (function () {
|
|
|
|
function Foo() {
|
|
|
|
}
|
|
|
|
Object.defineProperty(Foo, "Foo", {
|
|
|
|
get: function () {
|
|
|
|
return 0;
|
|
|
|
},
|
2015-02-07 03:45:09 +01:00
|
|
|
set: function (n) { },
|
2015-02-03 00:15:54 +01:00
|
|
|
enumerable: true,
|
|
|
|
configurable: true
|
|
|
|
});
|
|
|
|
return Foo;
|
|
|
|
})();
|