From ccd5352eb88e1a5ebe6b7f5f8d00606b144bad8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Segersva=CC=88rd?= Date: Wed, 9 Mar 2016 12:13:27 +0100 Subject: [PATCH] System doesn't have direct identifier access in TS's generated code. --- src/compiler/emitter.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index 67f9765d821..14f0e5bdf94 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -379,7 +379,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge const compilerOptions = host.getCompilerOptions(); const languageVersion = getEmitScriptTarget(compilerOptions); const modulekind = getEmitModuleKind(compilerOptions); - const hasIndirectAccessToImportedIdentifiers = modulekind !== ModuleKind.ES6 && modulekind !== ModuleKind.System; const sourceMapDataList: SourceMapData[] = compilerOptions.sourceMap || compilerOptions.inlineSourceMap ? [] : undefined; const emitterDiagnostics = createDiagnosticCollection(); let emitSkipped = false; @@ -1576,7 +1575,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge if (container) { if (container.kind === SyntaxKind.SourceFile) { // Identifier references module export - if (hasIndirectAccessToImportedIdentifiers) { + if (modulekind !== ModuleKind.ES6 && modulekind !== ModuleKind.System) { write("exports."); } } @@ -2169,7 +2168,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge // const foo_1 = require('./foo'); // exports.baz = { foo: foo_1.foo }; // - if (languageVersion < ScriptTarget.ES6 || (hasIndirectAccessToImportedIdentifiers && isImportedReference(node.name)) || isNamespaceExportReference(node.name) ) { + if (languageVersion < ScriptTarget.ES6 || (modulekind !== ModuleKind.ES6 && isImportedReference(node.name)) || isNamespaceExportReference(node.name) ) { // Emit identifier as an identifier write(": "); emit(node.name);