Correct the condition for variable statement emit in the declaraiton file

This commit is contained in:
Sheetal Nandi
2014-07-11 15:13:01 -07:00
parent cd14e36460
commit bb7f7fb8dd
7 changed files with 99 additions and 36 deletions

View File

@@ -273,6 +273,11 @@ module ts {
return s.parameters.length > 0 && (s.parameters[s.parameters.length - 1].flags & NodeFlags.Rest) !== 0;
}
export function getContainerOfModuleElementDeclaration(node: Declaration) {
// If the declaration is var declaration, then the parent is variable statement but we actually want the module
return node.kind === SyntaxKind.VariableDeclaration ? node.parent.parent : node.parent;
}
enum ParsingContext {
SourceElements, // Elements in source file
ModuleElements, // Elements in module declaration