@@ -443,9 +443,9 @@ func (b *Binder) declareSymbolAndAddToSymbolTable(node *ast.Node, symbolFlags as
443
443
return b .declareClassMember (node , symbolFlags , symbolExcludes )
444
444
case ast .KindEnumDeclaration :
445
445
return b .declareSymbol (ast .GetExports (b .container .Symbol ()), b .container .Symbol (), node , symbolFlags , symbolExcludes )
446
- case ast .KindTypeLiteral , ast .KindJSDocTypeLiteral , ast . KindObjectLiteralExpression , ast .KindInterfaceDeclaration , ast .KindJsxAttributes :
446
+ case ast .KindTypeLiteral , ast .KindObjectLiteralExpression , ast .KindInterfaceDeclaration , ast .KindJsxAttributes :
447
447
return b .declareSymbol (ast .GetMembers (b .container .Symbol ()), b .container .Symbol (), node , symbolFlags , symbolExcludes )
448
- case ast .KindFunctionType , ast .KindConstructorType , ast .KindCallSignature , ast .KindConstructSignature , ast . KindJSDocSignature ,
448
+ case ast .KindFunctionType , ast .KindConstructorType , ast .KindCallSignature , ast .KindConstructSignature ,
449
449
ast .KindIndexSignature , ast .KindMethodDeclaration , ast .KindMethodSignature , ast .KindConstructor , ast .KindGetAccessor ,
450
450
ast .KindSetAccessor , ast .KindFunctionDeclaration , ast .KindFunctionExpression , ast .KindArrowFunction ,
451
451
ast .KindClassStaticBlockDeclaration , ast .KindTypeAliasDeclaration , ast .KindJSTypeAliasDeclaration , ast .KindMappedType :
@@ -672,10 +672,8 @@ func (b *Binder) bind(node *ast.Node) bool {
672
672
case ast .KindSetAccessor :
673
673
b .bindPropertyOrMethodOrAccessor (node , ast .SymbolFlagsSetAccessor , ast .SymbolFlagsSetAccessorExcludes )
674
674
case ast .KindFunctionType , ast .KindConstructorType :
675
- // !!! KindJSDocSignature
676
675
b .bindFunctionOrConstructorType (node )
677
676
case ast .KindTypeLiteral , ast .KindMappedType :
678
- // !!! KindJSDocTypeLiteral
679
677
b .bindAnonymousDeclaration (node , ast .SymbolFlagsTypeLiteral , ast .InternalSymbolNameType )
680
678
case ast .KindObjectLiteralExpression :
681
679
b .bindAnonymousDeclaration (node , ast .SymbolFlagsObjectLiteral , ast .InternalSymbolNameObject )
@@ -1121,10 +1119,6 @@ func (b *Binder) bindVariableDeclarationOrBindingElement(node *ast.Node) {
1121
1119
}
1122
1120
1123
1121
func (b * Binder ) bindParameter (node * ast.Node ) {
1124
- // !!!
1125
- // if node.kind == KindJSDocParameterTag && b.container.kind != KindJSDocSignature {
1126
- // return
1127
- // }
1128
1122
decl := node .AsParameterDeclaration ()
1129
1123
if b .inStrictMode && node .Flags & ast .NodeFlagsAmbient == 0 {
1130
1124
// It is a SyntaxError if the identifier eval or arguments appears within a FormalParameterList of a
@@ -1190,17 +1184,6 @@ func (b *Binder) bindBlockScopedDeclaration(node *ast.Node, symbolFlags ast.Symb
1190
1184
}
1191
1185
1192
1186
func (b * Binder ) bindTypeParameter (node * ast.Node ) {
1193
- // !!!
1194
- // if isJSDocTemplateTag(node.parent) {
1195
- // var container *HasLocals = getEffectiveContainerForJSDocTemplateTag(node.parent)
1196
- // if container {
1197
- // Debug.assertNode(container, canHaveLocals)
1198
- // /* TODO(TS-TO-GO) QuestionQuestionEqualsToken BinaryExpression: container.locals ??= createSymbolTable() */ TODO
1199
- // b.declareSymbol(container.locals /*parent*/, nil, node, SymbolFlagsTypeParameter, SymbolFlagsTypeParameterExcludes)
1200
- // } else {
1201
- // b.declareSymbolAndAddToSymbolTable(node, SymbolFlagsTypeParameter, SymbolFlagsTypeParameterExcludes)
1202
- // }
1203
- // }
1204
1187
if node .Parent .Kind == ast .KindInferType {
1205
1188
container := b .getInferTypeContainer (node .Parent )
1206
1189
if container != nil {
@@ -1633,10 +1616,6 @@ func (b *Binder) bindChildren(node *ast.Node) {
1633
1616
b .bindCallExpressionFlow (node )
1634
1617
case ast .KindNonNullExpression :
1635
1618
b .bindNonNullExpressionFlow (node )
1636
- // case *JSDocTypedefTag, *JSDocCallbackTag, *JSDocEnumTag:
1637
- // b.bindJSDocTypeAlias(node)
1638
- // case *JSDocImportTag:
1639
- // b.bindJSDocImportTag(node)
1640
1619
case ast .KindSourceFile :
1641
1620
sourceFile := node .AsSourceFile ()
1642
1621
b .bindEachStatementFunctionsFirst (sourceFile .Statements )
@@ -2565,7 +2544,7 @@ func SetValueDeclaration(symbol *ast.Symbol, node *ast.Node) {
2565
2544
func GetContainerFlags (node * ast.Node ) ContainerFlags {
2566
2545
switch node .Kind {
2567
2546
case ast .KindClassExpression , ast .KindClassDeclaration , ast .KindEnumDeclaration , ast .KindObjectLiteralExpression , ast .KindTypeLiteral ,
2568
- ast .KindJSDocTypeLiteral , ast . KindJsxAttributes :
2547
+ ast .KindJsxAttributes :
2569
2548
return ContainerFlagsIsContainer
2570
2549
case ast .KindInterfaceDeclaration :
2571
2550
return ContainerFlagsIsContainer | ContainerFlagsIsInterface
@@ -2580,7 +2559,7 @@ func GetContainerFlags(node *ast.Node) ContainerFlags {
2580
2559
fallthrough
2581
2560
case ast .KindConstructor , ast .KindClassStaticBlockDeclaration :
2582
2561
return ContainerFlagsIsContainer | ContainerFlagsIsControlFlowContainer | ContainerFlagsHasLocals | ContainerFlagsIsFunctionLike | ContainerFlagsIsThisContainer
2583
- case ast .KindMethodSignature , ast .KindCallSignature , ast .KindJSDocSignature , ast . KindFunctionType , ast .KindConstructSignature , ast .KindConstructorType :
2562
+ case ast .KindMethodSignature , ast .KindCallSignature , ast .KindFunctionType , ast .KindConstructSignature , ast .KindConstructorType :
2584
2563
return ContainerFlagsIsContainer | ContainerFlagsIsControlFlowContainer | ContainerFlagsHasLocals | ContainerFlagsIsFunctionLike
2585
2564
case ast .KindFunctionDeclaration :
2586
2565
return ContainerFlagsIsContainer | ContainerFlagsIsControlFlowContainer | ContainerFlagsHasLocals | ContainerFlagsIsFunctionLike | ContainerFlagsIsThisContainer
@@ -2617,9 +2596,6 @@ func isNarrowingExpression(expr *ast.Node) bool {
2617
2596
case ast .KindCallExpression :
2618
2597
return hasNarrowableArgument (expr )
2619
2598
case ast .KindParenthesizedExpression :
2620
- // if isJSDocTypeAssertion(expr) {
2621
- // return false
2622
- // }
2623
2599
return isNarrowingExpression (expr .AsParenthesizedExpression ().Expression )
2624
2600
case ast .KindNonNullExpression :
2625
2601
return isNarrowingExpression (expr .AsNonNullExpression ().Expression )
0 commit comments