mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-15 12:51:30 -05:00
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:
committed by
GitHub
parent
57e2fe0462
commit
d371ae770d
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user