Consistently error on more than one 'export default'

This commit is contained in:
Anders Hejlsberg
2015-03-23 11:05:03 -07:00
parent 3f0cfe3619
commit 6074b3ea24
3 changed files with 5 additions and 5 deletions
+2 -2
View File
@@ -531,11 +531,11 @@ module ts {
case SyntaxKind.ExportAssignment:
if ((<ExportAssignment>node).expression.kind === SyntaxKind.Identifier) {
// An export default clause with an identifier exports all meanings of that identifier
declareSymbol(container.symbol.exports, container.symbol, <Declaration>node, SymbolFlags.Alias, SymbolFlags.AliasExcludes);
declareSymbol(container.symbol.exports, container.symbol, <Declaration>node, SymbolFlags.Alias, SymbolFlags.PropertyExcludes | SymbolFlags.AliasExcludes);
}
else {
// An export default clause with an expression exports a value
declareSymbol(container.symbol.exports, container.symbol, <Declaration>node, SymbolFlags.Property, SymbolFlags.PropertyExcludes);
declareSymbol(container.symbol.exports, container.symbol, <Declaration>node, SymbolFlags.Property, SymbolFlags.PropertyExcludes | SymbolFlags.AliasExcludes);
}
bindChildren(node, 0, /*isBlockScopeContainer*/ false);
break;
+2 -2
View File
@@ -613,7 +613,7 @@ module ts {
return resolveEntityName(<Identifier>node.expression, SymbolFlags.Value | SymbolFlags.Type | SymbolFlags.Namespace);
}
function getTargetOfImportDeclaration(node: Declaration): Symbol {
function getTargetOfAliasDeclaration(node: Declaration): Symbol {
switch (node.kind) {
case SyntaxKind.ImportEqualsDeclaration:
return getTargetOfImportEqualsDeclaration(<ImportEqualsDeclaration>node);
@@ -640,7 +640,7 @@ module ts {
if (!links.target) {
links.target = resolvingSymbol;
let node = getDeclarationOfAliasSymbol(symbol);
let target = getTargetOfImportDeclaration(node);
let target = getTargetOfAliasDeclaration(node);
if (links.target === resolvingSymbol) {
links.target = target || unknownSymbol;
}
+1 -1
View File
@@ -848,7 +848,7 @@ module ts {
node.kind === SyntaxKind.NamespaceImport ||
node.kind === SyntaxKind.ImportSpecifier ||
node.kind === SyntaxKind.ExportSpecifier ||
node.kind === SyntaxKind.ExportAssignment;
node.kind === SyntaxKind.ExportAssignment && (<ExportAssignment>node).expression.kind === SyntaxKind.Identifier;
}
export function getClassBaseTypeNode(node: ClassDeclaration) {