chore: Make field declarations explicit
This used to be valid code: ``` class Foo { constructor() { this.bar = ‘string’; } } ``` This will now fail since ‘bar’ is not explicitly defined as a field. We now have to write: ``` class Foo { bar:string; // << REQUIRED constructor() { this.bar = ‘string’; } } ```
This commit is contained in:
@ -189,6 +189,8 @@ export function main() {
|
||||
}
|
||||
|
||||
class Person {
|
||||
name:string;
|
||||
address:Address;
|
||||
constructor(name:string, address:Address = null) {
|
||||
this.name = name;
|
||||
this.address = address;
|
||||
@ -206,6 +208,7 @@ class Person {
|
||||
}
|
||||
|
||||
class Address {
|
||||
city:string;
|
||||
constructor(city:string) {
|
||||
this.city = city;
|
||||
}
|
||||
@ -216,12 +219,15 @@ class Address {
|
||||
}
|
||||
|
||||
class TestData {
|
||||
a;
|
||||
constructor(a) {
|
||||
this.a = a;
|
||||
}
|
||||
}
|
||||
|
||||
class LoggingDispatcher extends WatchGroupDispatcher {
|
||||
log:List;
|
||||
loggedValues:List;
|
||||
constructor() {
|
||||
this.log = null;
|
||||
this.loggedValues = null;
|
||||
|
Reference in New Issue
Block a user