mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-15 12:51:30 -05:00
Merge pull request #29298 from ajafff/this-reference-in-parameter
Allow referencing 'this' in parameters of functions in the constructor
This commit is contained in:
@@ -17019,7 +17019,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