Skip to content

Commit ccd5352

Browse files
author
Oskar Segersvärd
committed
System doesn't have direct identifier access in TS's generated code.
1 parent d742ca5 commit ccd5352

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

src/compiler/emitter.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
379379
const compilerOptions = host.getCompilerOptions();
380380
const languageVersion = getEmitScriptTarget(compilerOptions);
381381
const modulekind = getEmitModuleKind(compilerOptions);
382-
const hasIndirectAccessToImportedIdentifiers = modulekind !== ModuleKind.ES6 && modulekind !== ModuleKind.System;
383382
const sourceMapDataList: SourceMapData[] = compilerOptions.sourceMap || compilerOptions.inlineSourceMap ? [] : undefined;
384383
const emitterDiagnostics = createDiagnosticCollection();
385384
let emitSkipped = false;
@@ -1576,7 +1575,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
15761575
if (container) {
15771576
if (container.kind === SyntaxKind.SourceFile) {
15781577
// Identifier references module export
1579-
if (hasIndirectAccessToImportedIdentifiers) {
1578+
if (modulekind !== ModuleKind.ES6 && modulekind !== ModuleKind.System) {
15801579
write("exports.");
15811580
}
15821581
}
@@ -2169,7 +2168,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
21692168
// const foo_1 = require('./foo');
21702169
// exports.baz = { foo: foo_1.foo };
21712170
//
2172-
if (languageVersion < ScriptTarget.ES6 || (hasIndirectAccessToImportedIdentifiers && isImportedReference(node.name)) || isNamespaceExportReference(node.name) ) {
2171+
if (languageVersion < ScriptTarget.ES6 || (modulekind !== ModuleKind.ES6 && isImportedReference(node.name)) || isNamespaceExportReference(node.name) ) {
21732172
// Emit identifier as an identifier
21742173
write(": ");
21752174
emit(node.name);

0 commit comments

Comments
 (0)