diff --git a/src/compiler/transform.ts b/src/compiler/transform.ts index 89f5a122bc2..f49b3eafa17 100644 --- a/src/compiler/transform.ts +++ b/src/compiler/transform.ts @@ -298,7 +298,7 @@ namespace ts.transform { private hoistedFunctionDeclarationsStack: FunctionDeclaration[][] = []; // node stack - private nodeStackSize: number = 0; + private nodeStackSize: number = 1; private ancestorStack: Node[] = []; public compilerOptions: CompilerOptions; @@ -317,6 +317,7 @@ namespace ts.transform { this.generatedNameSet = generatedNameSet; this.nodeToGeneratedName = nodeToGeneratedName; this.getAncestorOrSelfCallback = offset => this.peekNode(offset); + this.currentNode = currentSourceFile; } public pushNode(node: Node): void {