mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Try using an unconditional no-op function.
This commit is contained in:
@@ -97,8 +97,9 @@ namespace ts {
|
||||
|
||||
type ForEachChildFunction = <T>(node: any, cbNode: (node: Node) => T | undefined, cbNodes?: (nodes: NodeArray<Node>) => T | undefined) => T | undefined;
|
||||
|
||||
const forEachChildTable: Array<ForEachChildFunction | undefined> = [];
|
||||
for (let i = 0; i < SyntaxKind.Count; i++) forEachChildTable.push(undefined);
|
||||
const forEachChildTable: (ForEachChildFunction | undefined)[] = [];
|
||||
const forEachChildNoOpFn: ForEachChildFunction = (_node, _cbNode, _cbNodes) => undefined;
|
||||
for (let i = 0; i < SyntaxKind.Count; i++) forEachChildTable.push(forEachChildNoOpFn);
|
||||
forEachChildTable[SyntaxKind.QualifiedName] = forEachQualifiedName;
|
||||
forEachChildTable[SyntaxKind.TypeParameter] = forEachTypeParameter;
|
||||
forEachChildTable[SyntaxKind.ShorthandPropertyAssignment] = forEachShorthandPropertyAssignment;
|
||||
|
||||
Reference in New Issue
Block a user