Add a jump-table for visitEachChild (#50266)

* Add a jump-table for visitEachChild

* Name each visitor function for better stack traces

* Fix node tests and some minor cleanup
This commit is contained in:
Ron Buckton 2022-08-18 15:03:17 -04:00 committed by GitHub
parent 7bafbeae90
commit 1592210673
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 997 additions and 859 deletions

View File

@ -885,6 +885,144 @@ namespace ts {
/* @internal */ jsDocCache?: readonly JSDocTag[]; // Cache for getJSDocTags
}
/* @internal */
export type HasChildren =
| Identifier
| QualifiedName
| ComputedPropertyName
| TypeParameterDeclaration
| ParameterDeclaration
| Decorator
| PropertySignature
| PropertyDeclaration
| MethodSignature
| MethodDeclaration
| ConstructorDeclaration
| GetAccessorDeclaration
| SetAccessorDeclaration
| ClassStaticBlockDeclaration
| CallSignatureDeclaration
| ConstructSignatureDeclaration
| IndexSignatureDeclaration
| TypePredicateNode
| TypeReferenceNode
| FunctionTypeNode
| ConstructorTypeNode
| TypeQueryNode
| TypeLiteralNode
| ArrayTypeNode
| TupleTypeNode
| OptionalTypeNode
| RestTypeNode
| UnionTypeNode
| IntersectionTypeNode
| ConditionalTypeNode
| InferTypeNode
| ImportTypeNode
| ImportTypeAssertionContainer
| NamedTupleMember
| ParenthesizedTypeNode
| TypeOperatorNode
| IndexedAccessTypeNode
| MappedTypeNode
| LiteralTypeNode
| TemplateLiteralTypeNode
| TemplateLiteralTypeSpan
| ObjectBindingPattern
| ArrayBindingPattern
| BindingElement
| ArrayLiteralExpression
| ObjectLiteralExpression
| PropertyAccessExpression
| ElementAccessExpression
| CallExpression
| NewExpression
| TaggedTemplateExpression
| TypeAssertion
| ParenthesizedExpression
| FunctionExpression
| ArrowFunction
| DeleteExpression
| TypeOfExpression
| VoidExpression
| AwaitExpression
| PrefixUnaryExpression
| PostfixUnaryExpression
| BinaryExpression
| ConditionalExpression
| TemplateExpression
| YieldExpression
| SpreadElement
| ClassExpression
| ExpressionWithTypeArguments
| AsExpression
| NonNullExpression
| MetaProperty
| TemplateSpan
| Block
| VariableStatement
| ExpressionStatement
| IfStatement
| DoStatement
| WhileStatement
| ForStatement
| ForInStatement
| ForOfStatement
| ContinueStatement
| BreakStatement
| ReturnStatement
| WithStatement
| SwitchStatement
| LabeledStatement
| ThrowStatement
| TryStatement
| VariableDeclaration
| VariableDeclarationList
| FunctionDeclaration
| ClassDeclaration
| InterfaceDeclaration
| TypeAliasDeclaration
| EnumDeclaration
| ModuleDeclaration
| ModuleBlock
| CaseBlock
| NamespaceExportDeclaration
| ImportEqualsDeclaration
| ImportDeclaration
| AssertClause
| AssertEntry
| ImportClause
| NamespaceImport
| NamespaceExport
| NamedImports
| ImportSpecifier
| ExportAssignment
| ExportDeclaration
| NamedExports
| ExportSpecifier
| ExternalModuleReference
| JsxElement
| JsxSelfClosingElement
| JsxOpeningElement
| JsxClosingElement
| JsxFragment
| JsxAttribute
| JsxAttributes
| JsxSpreadAttribute
| JsxExpression
| CaseClause
| DefaultClause
| HeritageClause
| CatchClause
| PropertyAssignment
| ShorthandPropertyAssignment
| SpreadAssignment
| EnumMember
| SourceFile
| PartiallyEmittedExpression
| CommaListExpression
;
export type HasJSDoc =
| ParameterDeclaration
| CallSignatureDeclaration

File diff suppressed because it is too large Load Diff