Microsoft/TypeScript
No error for undeclared #private property in `.js` files
Aperta
#35.962 aperta il 2 gen 2020
BugDomain: JavaScriptEffort: ModerateHelp Wanted
Metriche repository
- Star
- (108.860 stelle)
- Metriche merge PR
- (Metriche PR in attesa)
Descrizione
class Thing {
/**
* @param prop {string}
*/
constructor(prop) {
this.#prop = prop;
}
}
This class assigns to #prop, but it's an error to use #prop without declaring it.
This is reported as a SyntaxError, so this should report an error even outside of checkJs.