mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-18 07:29:16 -05:00
Merge branch 'release-1.3'
This commit is contained in:
@@ -375,13 +375,21 @@ module ts {
|
||||
var oldWriter = writer;
|
||||
forEach(importDeclarations, aliasToWrite => {
|
||||
var aliasEmitInfo = forEach(aliasDeclarationEmitInfo, declEmitInfo => declEmitInfo.declaration === aliasToWrite ? declEmitInfo : undefined);
|
||||
createAndSetNewTextWriterWithSymbolWriter();
|
||||
for (var declarationIndent = aliasEmitInfo.indent; declarationIndent; declarationIndent--) {
|
||||
increaseIndent();
|
||||
// If the alias was marked as not visible when we saw its declaration, we would have saved the aliasEmitInfo, but if we haven't yet visited the alias declaration
|
||||
// then we don't need to write it at this point. We will write it when we actually see its declaration
|
||||
// Eg.
|
||||
// export function bar(a: foo.Foo) { }
|
||||
// import foo = require("foo");
|
||||
// Writing of function bar would mark alias declaration foo as visible but we haven't yet visited that declaration so do nothing,
|
||||
// we would write alias foo declaration when we visit it since it would now be marked as visible
|
||||
if (aliasEmitInfo) {
|
||||
createAndSetNewTextWriterWithSymbolWriter();
|
||||
for (var declarationIndent = aliasEmitInfo.indent; declarationIndent; declarationIndent--) {
|
||||
increaseIndent();
|
||||
}
|
||||
writeImportDeclaration(aliasToWrite);
|
||||
aliasEmitInfo.asynchronousOutput = writer.getText();
|
||||
}
|
||||
|
||||
writeImportDeclaration(aliasToWrite);
|
||||
aliasEmitInfo.asynchronousOutput = writer.getText();
|
||||
});
|
||||
setWriter(oldWriter);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user