Skip to content

Commit 042d9c7

Browse files
committed
feedback
1 parent 067b70f commit 042d9c7

File tree

2 files changed

+27
-6
lines changed

2 files changed

+27
-6
lines changed

lib/src/model/package_graph.dart

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -554,12 +554,7 @@ class PackageGraph with CommentReferable, Nameable {
554554
alreadyTagged.add(key);
555555
// Mark that `publicLibrary` exports `libraryElement`.
556556
_libraryExports.putIfAbsent(libraryElement, () => {}).add(publicLibrary);
557-
558-
var exported = [
559-
...libraryElement.libraryExports,
560-
for (var unit in libraryElement.units) ...unit.libraryExports,
561-
];
562-
for (var exportedElement in exported) {
557+
for (var exportedElement in libraryElement.libraryExports) {
563558
var exportedLibrary = exportedElement.exportedLibrary;
564559
if (exportedLibrary != null) {
565560
// Follow the exports down; as `publicLibrary` exports `libraryElement`,

test/packages_test.dart

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -546,6 +546,32 @@ class PackagesTest extends DartdocTestBase {
546546
d.file('part.dart', '''
547547
part of 'lib.dart';
548548
export 'src/impl.dart';
549+
'''),
550+
d.dir('src', [
551+
d.file('impl.dart', 'class C {}'),
552+
]),
553+
]),
554+
],
555+
);
556+
var library = graph.libraries.named('lib');
557+
expect(library.qualifiedName, 'lib');
558+
expect(library.classes, isNotEmpty);
559+
expect(library.classes.single,
560+
isA<Class>().having((c) => c.name, 'name', 'C'));
561+
}
562+
563+
void test_exportedElements_fromPartOfPart() async {
564+
var graph = await bootPackageFromFiles(
565+
[
566+
d.dir('lib', [
567+
d.file('lib.dart', "part 'part1.dart';"),
568+
d.file('part1.dart', '''
569+
part of 'lib.dart';
570+
part 'part2.dart';
571+
'''),
572+
d.file('part2.dart', '''
573+
part of 'part1.dart';
574+
export 'src/impl.dart';
549575
'''),
550576
d.dir('src', [
551577
d.file('impl.dart', 'class C {}'),

0 commit comments

Comments
 (0)