Nested this container (#36495)

* Add nestedThisContainer test

* Fix #36492
This commit is contained in:
Brandon Bloom
2020-01-29 09:35:23 -08:00
committed by GitHub
parent 9fd0202e9f
commit 49282d9fba
5 changed files with 97 additions and 1 deletions

View File

@@ -21144,7 +21144,7 @@ namespace ts {
}
// In an assignment of the form 'obj.xxx = function(...)' or 'obj[xxx] = function(...)', the
// contextual type for 'this' is 'obj'.
const parent = func.parent;
const parent = walkUpParenthesizedExpressions(func.parent);
if (parent.kind === SyntaxKind.BinaryExpression && (<BinaryExpression>parent).operatorToken.kind === SyntaxKind.EqualsToken) {
const target = (<BinaryExpression>parent).left;
if (isAccessExpression(target)) {