Allow referencing 'this' in parameters of functions in the constructor

Fixes: #29286
This commit is contained in:
Klaus Meinhardt committed 2019-01-07 22:09:27 +01:00
1 parent 5135b83bf9
commit 4cd859aa85
9 files changed
+56 -18

No files matched your search

+1 -1
View File
@@ -16831,7 +16831,7 @@ namespace ts {
}
function isInConstructorArgumentInitializer(node: Node, constructorDecl: Node): boolean {
return !!findAncestor(node, n => n === constructorDecl ? "quit" : n.kind === SyntaxKind.Parameter);
return !!findAncestor(node, n => isFunctionLikeDeclaration(n) ? "quit" : n.kind === SyntaxKind.Parameter && n.parent === constructorDecl);
}
function checkSuperExpression(node: Node): Type {