File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -11366,18 +11366,25 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
1136611366 if (!isThisProperty(node) || !isAutoTypedProperty(prop)) {
1136711367 return false;
1136811368 }
11369- const autoContainer = getAutoContainer(node);
11369+ const autoContainer = getAutoContainer(node)! ;
1137011370 return isClassStaticBlockDeclaration(autoContainer) && (prop.parent && getClassLikeDeclarationOfSymbol(prop.parent)) === autoContainer.parent;
1137111371 }
1137211372 if (!isConstructorDeclaredProperty(prop) && (!isThisProperty(node) || !isAutoTypedProperty(prop))) {
1137311373 return false;
1137411374 }
11375- const autoContainer = getAutoContainer(node);
11375+ const autoContainer = getAutoContainer(node)! ;
1137611376 return isConstructorDeclaration(autoContainer) && (prop.parent && getClassLikeDeclarationOfSymbol(prop.parent)) === autoContainer.parent || autoContainer === getDeclaringConstructor(prop);
1137711377 }
1137811378
1137911379 function getAutoContainer(node: Node) {
11380- return findAncestor(node.parent, node => !!getContainingFunctionOrClassStaticBlock(node) && !getImmediatelyInvokedFunctionExpression(node))!;
11380+ let container = getContainingFunctionOrClassStaticBlock(node);
11381+ while (container) {
11382+ if (getImmediatelyInvokedFunctionExpression(container)) {
11383+ container = getContainingFunctionOrClassStaticBlock(container);
11384+ continue;
11385+ }
11386+ return container;
11387+ }
1138111388 }
1138211389
1138311390 function getDeclaringConstructor(symbol: Symbol) {
You can’t perform that action at this time.
0 commit comments