Bind assignments to 'this' within static blocks in JS files (#46472)

* Add failing test case.

* Handle 'this' assignments on class static blocks in JavaScript.

* Accepted baselines.
This commit is contained in:
Daniel Rosenwasser
2021-10-22 15:44:35 -07:00
committed by GitHub
parent de1ac8191e
commit 334b8eaa57
6 changed files with 234 additions and 0 deletions

View File

@@ -2947,6 +2947,7 @@ namespace ts {
case SyntaxKind.MethodDeclaration:
case SyntaxKind.GetAccessor:
case SyntaxKind.SetAccessor:
case SyntaxKind.ClassStaticBlockDeclaration:
// this.foo assignment in a JavaScript class
// Bind this property to the containing class
const containingClass = thisContainer.parent;