File tree Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -358,16 +358,13 @@ namespace ts {
358
358
}
359
359
else {
360
360
// 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 ) ) ) {
367
366
message = Diagnostics . A_module_cannot_have_multiple_default_exports ;
368
- break ;
369
- }
370
- }
367
+ }
371
368
}
372
369
}
373
370
You can’t perform that action at this time.
0 commit comments