From d0fc3948b58d006ef003174af7e1c3e7c7b084e1 Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Mon, 23 Nov 2015 12:22:08 -0800 Subject: [PATCH] Correct comments, use destructuring --- src/compiler/checker.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index d95d3e07686..2a853611a43 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -1142,7 +1142,7 @@ namespace ts { } for (const id in lookupTable) { const { exportsWithDuplicate } = lookupTable[id]; - // It's not an error if the file with multiple export *'s with duplicate names exports a member with that name itself + // Its not an error if the file with multiple export *'s with duplicate names exports a member with that name itself if (id === "export=" || !exportsWithDuplicate.length || id in symbols) { continue; } @@ -14079,10 +14079,10 @@ namespace ts { if (id === "__export") { continue; } - const exportedSymbol = exports[id]; - // 15.2.1.1 It is a Syntax Error if the ExportedNames of ModuleItemList contains any duplicate entries. (TS Exceptions: namespaces, function overloads, enums, and interfaces) - if (!(exportedSymbol.flags & SymbolFlags.Namespace || exportedSymbol.flags & SymbolFlags.Interface || exportedSymbol.flags & SymbolFlags.Enum) && exportedSymbol.declarations.length > 1) { - const exportedDeclarations: Declaration[] = filter(exportedSymbol.declarations, isNotOverload); + const {declarations, flags} = exports[id]; + // ECMA262: 15.2.1.1 It is a Syntax Error if the ExportedNames of ModuleItemList contains any duplicate entries. (TS Exceptions: namespaces, function overloads, enums, and interfaces) + if (!(flags & (SymbolFlags.Namespace |SymbolFlags.Interface | SymbolFlags.Enum)) && declarations.length > 1) { + const exportedDeclarations: Declaration[] = filter(declarations, isNotOverload); if (exportedDeclarations.length > 1) { for (const declaration of exportedDeclarations) { diagnostics.add(createDiagnosticForNode(declaration, Diagnostics.Cannot_redeclare_exported_variable_0, id));