File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -358,16 +358,13 @@ namespace ts {
358358 }
359359 else {
360360 // This is to properly report an error in the case "export default { }" is after export default of class declaration or function declaration.
361- for ( const declaration of symbol . declarations ) {
362- // Error on multiple export default in the following case:
363- // 1. multiple export default of class declaration or function declaration by checking NodeFlags.Default
364- // 2. multiple export default of export assignment. This one doesn't have NodeFlags.Default on (as export default doesn't considered as modifiers)
365- if ( ( declaration . flags & NodeFlags . Default ) ||
366- ( declaration . kind === SyntaxKind . ExportAssignment && ! ( < ExportAssignment > node ) . isExportEquals ) ) {
361+ // Error on multiple export default in the following case:
362+ // 1. multiple export default of class declaration or function declaration by checking NodeFlags.Default
363+ // 2. multiple export default of export assignment. This one doesn't have NodeFlags.Default on (as export default doesn't considered as modifiers)
364+ if ( symbol . declarations && symbol . declarations . length &&
365+ ( isDefaultExport || ( node . kind === SyntaxKind . ExportAssignment && ! ( < ExportAssignment > node ) . isExportEquals ) ) ) {
367366 message = Diagnostics . A_module_cannot_have_multiple_default_exports ;
368- break ;
369- }
370- }
367+ }
371368 }
372369 }
373370
You can’t perform that action at this time.
0 commit comments