diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index be298aaf050..dc53215263b 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -97,7 +97,8 @@ namespace ts { type ForEachChildFunction = (node: any, cbNode: (node: Node) => T | undefined, cbNodes?: (nodes: NodeArray) => T | undefined) => T | undefined; - const forEachChildTable = new Array(SyntaxKind.Count); + const forEachChildTable: Array = []; + for (let i = 0; i < SyntaxKind.Count; i++) forEachChildTable.push(undefined); forEachChildTable[SyntaxKind.QualifiedName] = forEachQualifiedName; forEachChildTable[SyntaxKind.TypeParameter] = forEachTypeParameter; forEachChildTable[SyntaxKind.ShorthandPropertyAssignment] = forEachShorthandPropertyAssignment;