From 766cb68f7c2417b6edade146374c9e9d010db9ab Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Tue, 17 Mar 2015 13:03:13 -0700 Subject: [PATCH] Add comments --- src/compiler/checker.ts | 2 ++ src/compiler/emitter.ts | 1 + 2 files changed, 3 insertions(+) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 7cfe69c5620..0bd57740803 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -10982,6 +10982,8 @@ module ts { function getExportNameSubstitution(symbol: Symbol, location: Node): string { if (isExternalModuleSymbol(symbol.parent)) { var symbolName = unescapeIdentifier(symbol.name); + // If this is es6 or higher, just use the name of the export + // no need to qualify it. if (languageVersion >= ScriptTarget.ES6) { return symbolName; } diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index 42856a57077..126ac7a4e69 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -4903,6 +4903,7 @@ module ts { } write("class "); + // check if this is an "export default class" as it may not have a name if (node.name || !(node.flags & NodeFlags.Default)) { emitDeclarationName(node); }