mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Consistently error on more than one 'export default'
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user