@@ -1769,34 +1769,39 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
1769
1769
write ( "." ) ;
1770
1770
}
1771
1771
}
1772
- else if ( modulekind !== ModuleKind . ES6 ) {
1773
- let declaration = resolver . getReferencedImportDeclaration ( node ) ;
1774
- if ( declaration ) {
1775
- if ( declaration . kind === SyntaxKind . ImportClause ) {
1776
- // Identifier references default import
1777
- write ( getGeneratedNameForNode ( < ImportDeclaration > declaration . parent ) ) ;
1778
- write ( languageVersion === ScriptTarget . ES3 ? "[\"default\"]" : ".default" ) ;
1779
- return ;
1780
- }
1781
- else if ( declaration . kind === SyntaxKind . ImportSpecifier ) {
1782
- // Identifier references named import
1783
- write ( getGeneratedNameForNode ( < ImportDeclaration > declaration . parent . parent . parent ) ) ;
1784
- let name = ( < ImportSpecifier > declaration ) . propertyName || ( < ImportSpecifier > declaration ) . name ;
1785
- let identifier = getSourceTextOfNodeFromSourceFile ( currentSourceFile , name ) ;
1786
- if ( languageVersion === ScriptTarget . ES3 && identifier === "default" ) {
1787
- write ( `["default"]` ) ;
1772
+ else {
1773
+ if ( modulekind !== ModuleKind . ES6 ) {
1774
+ let declaration = resolver . getReferencedImportDeclaration ( node ) ;
1775
+ if ( declaration ) {
1776
+ if ( declaration . kind === SyntaxKind . ImportClause ) {
1777
+ // Identifier references default import
1778
+ write ( getGeneratedNameForNode ( < ImportDeclaration > declaration . parent ) ) ;
1779
+ write ( languageVersion === ScriptTarget . ES3 ? "[\"default\"]" : ".default" ) ;
1780
+ return ;
1788
1781
}
1789
- else {
1790
- write ( "." ) ;
1791
- write ( identifier ) ;
1782
+ else if ( declaration . kind === SyntaxKind . ImportSpecifier ) {
1783
+ // Identifier references named import
1784
+ write ( getGeneratedNameForNode ( < ImportDeclaration > declaration . parent . parent . parent ) ) ;
1785
+ let name = ( < ImportSpecifier > declaration ) . propertyName || ( < ImportSpecifier > declaration ) . name ;
1786
+ let identifier = getSourceTextOfNodeFromSourceFile ( currentSourceFile , name ) ;
1787
+ if ( languageVersion === ScriptTarget . ES3 && identifier === "default" ) {
1788
+ write ( `["default"]` ) ;
1789
+ }
1790
+ else {
1791
+ write ( "." ) ;
1792
+ write ( identifier ) ;
1793
+ }
1794
+ return ;
1792
1795
}
1793
- return ;
1794
1796
}
1795
1797
}
1796
- declaration = resolver . getReferencedNestedRedeclaration ( node ) ;
1797
- if ( declaration ) {
1798
- write ( getGeneratedNameForNode ( declaration . name ) ) ;
1799
- return ;
1798
+
1799
+ if ( languageVersion !== ScriptTarget . ES6 ) {
1800
+ let declaration = resolver . getReferencedNestedRedeclaration ( node ) ;
1801
+ if ( declaration ) {
1802
+ write ( getGeneratedNameForNode ( declaration . name ) ) ;
1803
+ return ;
1804
+ }
1800
1805
}
1801
1806
}
1802
1807
@@ -2785,7 +2790,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
2785
2790
2786
2791
/**
2787
2792
* Emit ES7 exponentiation operator downlevel using Math.pow
2788
- * @param node a binary expression node containing exponentiationOperator (**, **=)
2793
+ * @param node a binary expression node containing exponentiationOperator (**, **=)
2789
2794
*/
2790
2795
function emitExponentiationOperator ( node : BinaryExpression ) {
2791
2796
let leftHandSideExpression = node . left ;
0 commit comments