You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The ES6 spec for classes doesn't include properties making the code below valid JavaScript (and invalid TypeScript) code
classCat{constructor(name){this.name=name;}speak(){console.log(this.name+' makes a noise.');}}
When feeding code like this into the TypeScript compiler you get an error about this.name not being defined. TypeScript should be able to detect that this is a JavaScript class (*.js,*.jsx-files) and (1) not mark the property access this.name as error and (2) offer tooling support for the data property (IntelliSense et al)
The text was updated successfully, but these errors were encountered:
We have another issue somewhere tracking adding support for this style of pattern (ie enumerate assignments to this in the constructor body and consider them instance properties implicitly) but I can't find it at the moment.
The ES6 spec for classes doesn't include properties making the code below valid JavaScript (and invalid TypeScript) code
When feeding code like this into the TypeScript compiler you get an error about
this.name
not being defined. TypeScript should be able to detect that this is a JavaScript class (*.js,*.jsx
-files) and (1) not mark the property accessthis.name
as error and (2) offer tooling support for the data property (IntelliSense et al)The text was updated successfully, but these errors were encountered: