Skip to content

Commit d0fc394

Browse files
committed
Correct comments, use destructuring
1 parent d9c6f3d commit d0fc394

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

src/compiler/checker.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1142,7 +1142,7 @@ namespace ts {
11421142
}
11431143
for (const id in lookupTable) {
11441144
const { exportsWithDuplicate } = lookupTable[id];
1145-
// It's not an error if the file with multiple export *'s with duplicate names exports a member with that name itself
1145+
// Its not an error if the file with multiple export *'s with duplicate names exports a member with that name itself
11461146
if (id === "export=" || !exportsWithDuplicate.length || id in symbols) {
11471147
continue;
11481148
}
@@ -14079,10 +14079,10 @@ namespace ts {
1407914079
if (id === "__export") {
1408014080
continue;
1408114081
}
14082-
const exportedSymbol = exports[id];
14083-
// 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)
14084-
if (!(exportedSymbol.flags & SymbolFlags.Namespace || exportedSymbol.flags & SymbolFlags.Interface || exportedSymbol.flags & SymbolFlags.Enum) && exportedSymbol.declarations.length > 1) {
14085-
const exportedDeclarations: Declaration[] = filter(exportedSymbol.declarations, isNotOverload);
14082+
const {declarations, flags} = exports[id];
14083+
// 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)
14084+
if (!(flags & (SymbolFlags.Namespace |SymbolFlags.Interface | SymbolFlags.Enum)) && declarations.length > 1) {
14085+
const exportedDeclarations: Declaration[] = filter(declarations, isNotOverload);
1408614086
if (exportedDeclarations.length > 1) {
1408714087
for (const declaration of exportedDeclarations) {
1408814088
diagnostics.add(createDiagnosticForNode(declaration, Diagnostics.Cannot_redeclare_exported_variable_0, id));

0 commit comments

Comments
 (0)