mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-14 18:39:19 -05:00
When targeting ES3 emit default alias as indexer
This commit is contained in:
@@ -1515,8 +1515,14 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
|
||||
else if (declaration.kind === SyntaxKind.ImportSpecifier) {
|
||||
// Identifier references named import
|
||||
write(getGeneratedNameForNode(<ImportDeclaration>declaration.parent.parent.parent));
|
||||
write(".");
|
||||
writeTextOfNode(currentSourceFile, (<ImportSpecifier>declaration).propertyName || (<ImportSpecifier>declaration).name);
|
||||
var name = (<ImportSpecifier>declaration).propertyName || (<ImportSpecifier>declaration).name;
|
||||
var identifier = getSourceTextOfNodeFromSourceFile(currentSourceFile, name);
|
||||
if (languageVersion == ScriptTarget.ES3 && identifier === "default") {
|
||||
write(`["default"]`);
|
||||
} else {
|
||||
write(".");
|
||||
write(identifier);
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user