Skip to content

Commit eae289c

Browse files
Emit 'exports.' if the shorthand is a general export.
1 parent d54094c commit eae289c

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/compiler/emitter.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2150,9 +2150,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
21502150
}
21512151

21522152
// Return true if identifier resolves to an exported member of a namespace
2153-
function isNamespaceExportReference(node: Identifier) {
2153+
function isExportReference(node: Identifier) {
21542154
const container = resolver.getReferencedExportContainer(node);
2155-
return container && container.kind !== SyntaxKind.SourceFile;
2155+
return !!container;
21562156
}
21572157

21582158
// Return true if identifier resolves to an imported identifier
@@ -2185,10 +2185,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
21852185
// const foo_1 = require('./foo');
21862186
// exports.baz = { foo: foo_1.foo };
21872187
//
2188-
if (languageVersion < ScriptTarget.ES6 || (modulekind !== ModuleKind.ES6 && isImportedReference(node.name)) || isNamespaceExportReference(node.name) ) {
2188+
if (languageVersion < ScriptTarget.ES6 || (modulekind !== ModuleKind.ES6 && isImportedReference(node.name)) || isExportReference(node.name)) {
21892189
// Emit identifier as an identifier
21902190
write(": ");
2191-
emit(node.name);
2191+
emitExpressionIdentifier(node.name);
21922192
}
21932193

21942194
if (languageVersion >= ScriptTarget.ES6 && node.objectAssignmentInitializer) {

0 commit comments

Comments
 (0)