Skip to content

Commit a4a7669

Browse files
committed
Add super to control flow.
It is handled the same way as 'this'
1 parent 0459987 commit a4a7669

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/compiler/binder.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -703,6 +703,7 @@ namespace ts {
703703
function isNarrowableReference(expr: Expression): boolean {
704704
return expr.kind === SyntaxKind.Identifier ||
705705
expr.kind === SyntaxKind.ThisKeyword ||
706+
expr.kind === SyntaxKind.SuperKeyword ||
706707
expr.kind === SyntaxKind.PropertyAccessExpression && isNarrowableReference((<PropertyAccessExpression>expr).expression);
707708
}
708709

src/compiler/checker.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10347,6 +10347,8 @@ namespace ts {
1034710347
getExportSymbolOfValueSymbolIfExported(getResolvedSymbol(<Identifier>source)) === getSymbolOfNode(target);
1034810348
case SyntaxKind.ThisKeyword:
1034910349
return target.kind === SyntaxKind.ThisKeyword;
10350+
case SyntaxKind.SuperKeyword:
10351+
return target.kind === SyntaxKind.SuperKeyword;
1035010352
case SyntaxKind.PropertyAccessExpression:
1035110353
return target.kind === SyntaxKind.PropertyAccessExpression &&
1035210354
(<PropertyAccessExpression>source).name.text === (<PropertyAccessExpression>target).name.text &&
@@ -11483,6 +11485,7 @@ namespace ts {
1148311485
switch (expr.kind) {
1148411486
case SyntaxKind.Identifier:
1148511487
case SyntaxKind.ThisKeyword:
11488+
case SyntaxKind.SuperKeyword:
1148611489
case SyntaxKind.PropertyAccessExpression:
1148711490
return narrowTypeByTruthiness(type, expr, assumeTrue);
1148811491
case SyntaxKind.CallExpression:

0 commit comments

Comments
 (0)