No this-property assignments in TS (#40009)

* No this-property assignments in TS

Even when `this` is aliased, which I mistakenly allowed in #39908.

* remove errant file
This commit is contained in:
Nathan Shively-Sanders authored and GitHub committed 2020-08-11 15:46:49 -07:00
1 parent 57e2fe0462
commit d371ae770d
5 files changed
+73 -1

No files matched your search

+1 -1
View File
@@ -2487,7 +2487,7 @@ namespace ts {
break;
case AssignmentDeclarationKind.Property:
const expression = ((node as BinaryExpression).left as AccessExpression).expression;
if (isIdentifier(expression)) {
if (isInJSFile(node) && isIdentifier(expression)) {
const symbol = lookupSymbolForName(blockScopeContainer, expression.escapedText);
if (isThisInitializedDeclaration(symbol?.valueDeclaration)) {
bindThisPropertyAssignment(node as BindablePropertyAssignmentExpression);