From e984fb80b606bdc710e00c8f8db3814fdf241e7b Mon Sep 17 00:00:00 2001 From: Ron Buckton Date: Fri, 7 Aug 2015 16:14:36 -0700 Subject: [PATCH] Set current source file as the first node in VisitorContext --- src/compiler/transform.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 {