mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Add early bail out for token nodes
This commit is contained in:
@@ -51,7 +51,7 @@ namespace ts {
|
||||
* @param cbNodes a callback to be invoked for embedded array
|
||||
*/
|
||||
export function forEachChild<T>(node: Node, cbNode: (node: Node) => T | undefined, cbNodes?: (nodes: NodeArray<Node>) => T | undefined): T | undefined {
|
||||
if (!node) {
|
||||
if (!node || node.kind <= SyntaxKind.LastToken) {
|
||||
return;
|
||||
}
|
||||
switch (node.kind) {
|
||||
|
||||
Reference in New Issue
Block a user