mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-11-18 20:11:14 +00:00
Allow referencing 'this' in parameters of functions in the constructor
Fixes: #29286
This commit is contained in:
1 parent
5135b83bf9
commit
4cd859aa85
9 files changed
+56
-18
No files matched your search
@@ -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 {
|
||||
|
||||
Reference in new issue
Block a user