File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -97,9 +97,8 @@ namespace ts {
9797
9898 type ForEachChildFunction = <T>(node: any, cbNode: (node: Node) => T | undefined, cbNodes?: (nodes: NodeArray<Node>) => T | undefined) => T | undefined;
9999
100- const forEachChildTable: ForEachChildFunction[] = [];
101- const forEachChildNoOpFn: ForEachChildFunction = (_node, _cbNode, _cbNodes) => undefined;
102- for (let i = 0; i < SyntaxKind.Count; i++) forEachChildTable.push(forEachChildNoOpFn);
100+ const forEachChildTable: (ForEachChildFunction | undefined)[] = [];
101+ for (let i = 0; i < SyntaxKind.Count; i++) forEachChildTable.push(undefined);
103102 forEachChildTable[SyntaxKind.QualifiedName] = forEachChildInQualifiedName;
104103 forEachChildTable[SyntaxKind.TypeParameter] = forEachChildInTypeParameter;
105104 forEachChildTable[SyntaxKind.ShorthandPropertyAssignment] = forEachChildInShorthandPropertyAssignment;
@@ -1088,7 +1087,8 @@ namespace ts {
10881087 return;
10891088 }
10901089
1091- return forEachChildTable[node.kind](node, cbNode, cbNodes);
1090+ const fn = forEachChildTable[node.kind];
1091+ return fn === undefined ? undefined : fn(node, cbNode, cbNodes);
10921092 }
10931093
10941094 /** @internal */
You can’t perform that action at this time.
0 commit comments