mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-04-17 01:00:41 -05:00
Check for this.xxx access to previously declared uninitialized property
This commit is contained in:
@@ -1366,7 +1366,7 @@ namespace ts {
|
||||
return sourceFiles.indexOf(declarationFile) <= sourceFiles.indexOf(useFile);
|
||||
}
|
||||
|
||||
if (declaration.pos <= usage.pos) {
|
||||
if (declaration.pos <= usage.pos && !(isPropertyDeclaration(declaration) && isThisProperty(usage.parent) && !declaration.initializer && !declaration.exclamationToken)) {
|
||||
// declaration is before usage
|
||||
if (declaration.kind === SyntaxKind.BindingElement) {
|
||||
// still might be illegal if declaration and usage are both binding elements (eg var [a = b, b = b] = [1, 2])
|
||||
|
||||
Reference in New Issue
Block a user