Skip to content

Commit 56c8d67

Browse files
committed
Add a jump-table for visitEachChild
1 parent 8a24fe7 commit 56c8d67

File tree

2 files changed

+912
-909
lines changed

2 files changed

+912
-909
lines changed

src/compiler/types.ts

+138
Original file line numberDiff line numberDiff line change
@@ -885,6 +885,144 @@ namespace ts {
885885
/* @internal */ jsDocCache?: readonly JSDocTag[]; // Cache for getJSDocTags
886886
}
887887

888+
/* @internal */
889+
export type HasChildren =
890+
| Identifier
891+
| QualifiedName
892+
| ComputedPropertyName
893+
| TypeParameterDeclaration
894+
| ParameterDeclaration
895+
| Decorator
896+
| PropertySignature
897+
| PropertyDeclaration
898+
| MethodSignature
899+
| MethodDeclaration
900+
| ConstructorDeclaration
901+
| GetAccessorDeclaration
902+
| SetAccessorDeclaration
903+
| ClassStaticBlockDeclaration
904+
| CallSignatureDeclaration
905+
| ConstructSignatureDeclaration
906+
| IndexSignatureDeclaration
907+
| TypePredicateNode
908+
| TypeReferenceNode
909+
| FunctionTypeNode
910+
| ConstructorTypeNode
911+
| TypeQueryNode
912+
| TypeLiteralNode
913+
| ArrayTypeNode
914+
| TupleTypeNode
915+
| OptionalTypeNode
916+
| RestTypeNode
917+
| UnionTypeNode
918+
| IntersectionTypeNode
919+
| ConditionalTypeNode
920+
| InferTypeNode
921+
| ImportTypeNode
922+
| ImportTypeAssertionContainer
923+
| NamedTupleMember
924+
| ParenthesizedTypeNode
925+
| TypeOperatorNode
926+
| IndexedAccessTypeNode
927+
| MappedTypeNode
928+
| LiteralTypeNode
929+
| TemplateLiteralTypeNode
930+
| TemplateLiteralTypeSpan
931+
| ObjectBindingPattern
932+
| ArrayBindingPattern
933+
| BindingElement
934+
| ArrayLiteralExpression
935+
| ObjectLiteralExpression
936+
| PropertyAccessExpression
937+
| ElementAccessExpression
938+
| CallExpression
939+
| NewExpression
940+
| TaggedTemplateExpression
941+
| TypeAssertion
942+
| ParenthesizedExpression
943+
| FunctionExpression
944+
| ArrowFunction
945+
| DeleteExpression
946+
| TypeOfExpression
947+
| VoidExpression
948+
| AwaitExpression
949+
| PrefixUnaryExpression
950+
| PostfixUnaryExpression
951+
| BinaryExpression
952+
| ConditionalExpression
953+
| TemplateExpression
954+
| YieldExpression
955+
| SpreadElement
956+
| ClassExpression
957+
| ExpressionWithTypeArguments
958+
| AsExpression
959+
| NonNullExpression
960+
| MetaProperty
961+
| TemplateSpan
962+
| Block
963+
| VariableStatement
964+
| ExpressionStatement
965+
| IfStatement
966+
| DoStatement
967+
| WhileStatement
968+
| ForStatement
969+
| ForInStatement
970+
| ForOfStatement
971+
| ContinueStatement
972+
| BreakStatement
973+
| ReturnStatement
974+
| WithStatement
975+
| SwitchStatement
976+
| LabeledStatement
977+
| ThrowStatement
978+
| TryStatement
979+
| VariableDeclaration
980+
| VariableDeclarationList
981+
| FunctionDeclaration
982+
| ClassDeclaration
983+
| InterfaceDeclaration
984+
| TypeAliasDeclaration
985+
| EnumDeclaration
986+
| ModuleDeclaration
987+
| ModuleBlock
988+
| CaseBlock
989+
| NamespaceExportDeclaration
990+
| ImportEqualsDeclaration
991+
| ImportDeclaration
992+
| AssertClause
993+
| AssertEntry
994+
| ImportClause
995+
| NamespaceImport
996+
| NamespaceExport
997+
| NamedImports
998+
| ImportSpecifier
999+
| ExportAssignment
1000+
| ExportDeclaration
1001+
| NamedExports
1002+
| ExportSpecifier
1003+
| ExternalModuleReference
1004+
| JsxElement
1005+
| JsxSelfClosingElement
1006+
| JsxOpeningElement
1007+
| JsxClosingElement
1008+
| JsxFragment
1009+
| JsxAttribute
1010+
| JsxAttributes
1011+
| JsxSpreadAttribute
1012+
| JsxExpression
1013+
| CaseClause
1014+
| DefaultClause
1015+
| HeritageClause
1016+
| CatchClause
1017+
| PropertyAssignment
1018+
| ShorthandPropertyAssignment
1019+
| SpreadAssignment
1020+
| EnumMember
1021+
| SourceFile
1022+
| PartiallyEmittedExpression
1023+
| CommaListExpression
1024+
;
1025+
8881026
export type HasJSDoc =
8891027
| ParameterDeclaration
8901028
| CallSignatureDeclaration

0 commit comments

Comments
 (0)