1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
|
//// [propertyOrdering.ts]
class Foo {
constructor(store: string) { }
public foo() {
return this._store.length; // shouldn't be an error
}
public _store = store; // no repro if this is first line in class body
public bar() { return this.store; } // should be an error
}
class Bar {
public foo() {
return this._store.length; // shouldn't be an error
}
constructor(store: string) {
this._store = store;
}
}
//// [propertyOrdering.js]
var Foo = /** @class */ (function () {
function Foo(store) {
this._store = store; // no repro if this is first line in class body
}
Foo.prototype.foo = function () {
return this._store.length; // shouldn't be an error
};
Foo.prototype.bar = function () { return this.store; }; // should be an error
return Foo;
}());
var Bar = /** @class */ (function () {
function Bar(store) {
this._store = store;
}
Bar.prototype.foo = function () {
return this._store.length; // shouldn't be an error
};
return Bar;
}());
|