Skip to content

Commit 981ef7f

Browse files
committed
Excluding "default" member from "export *" per ES6 specification
1 parent b54b710 commit 981ef7f

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/compiler/checker.ts

+9-9
Original file line numberDiff line numberDiff line change
@@ -248,14 +248,6 @@ module ts {
248248
}
249249
}
250250

251-
function extendSymbolTable(target: SymbolTable, source: SymbolTable) {
252-
for (var id in source) {
253-
if (!hasProperty(target, id)) {
254-
target[id] = source[id];
255-
}
256-
}
257-
}
258-
259251
function getSymbolLinks(symbol: Symbol): SymbolLinks {
260252
if (symbol.flags & SymbolFlags.Transient) return <TransientSymbol>symbol;
261253
if (!symbol.id) symbol.id = nextSymbolId++;
@@ -723,6 +715,14 @@ module ts {
723715
return links.resolvedExports || (links.resolvedExports = getExportsForModule(moduleSymbol));
724716
}
725717

718+
function extendExportSymbols(target: SymbolTable, source: SymbolTable) {
719+
for (var id in source) {
720+
if (id !== "default" && !hasProperty(target, id)) {
721+
target[id] = source[id];
722+
}
723+
}
724+
}
725+
726726
function getExportsForModule(moduleSymbol: Symbol): SymbolTable {
727727
if (compilerOptions.target < ScriptTarget.ES6) {
728728
// A default export hides all other exports in CommonJS and AMD modules
@@ -747,7 +747,7 @@ module ts {
747747
if (!result) {
748748
result = cloneSymbolTable(moduleSymbol.exports);
749749
}
750-
extendSymbolTable(result, symbol.exports);
750+
extendExportSymbols(result, symbol.exports);
751751
}
752752
// All export * declarations are collected in an __export symbol by the binder
753753
var exportStars = symbol.exports["__export"];

0 commit comments

Comments
 (0)