| Index: sdk/lib/_internal/compiler/implementation/mirrors/mirrors_util.dart
|
| diff --git a/sdk/lib/_internal/compiler/implementation/mirrors/mirrors_util.dart b/sdk/lib/_internal/compiler/implementation/mirrors/mirrors_util.dart
|
| index 41a085e67cb02f9a03bc9f855be234a0b88de451..07f407a59c7e8132614b759dcc9ef4bf72345db8 100644
|
| --- a/sdk/lib/_internal/compiler/implementation/mirrors/mirrors_util.dart
|
| +++ b/sdk/lib/_internal/compiler/implementation/mirrors/mirrors_util.dart
|
| @@ -159,3 +159,29 @@ String stripComment(String comment) {
|
| }
|
| throw new ArgumentError('Invalid comment $comment');
|
| }
|
| +
|
| +/**
|
| + * Returns an iterable over all exports found transitively from [library].
|
| + */
|
| +Iterable<LibraryDependencyMirror> getExports(LibraryMirror library) {
|
| + bool isExport(LibraryDependencyMirror mirror) => mirror.isExport;
|
| +
|
| + List<LibraryDependencyMirror> exports = <LibraryDependencyMirror>[];
|
| +
|
| + Set<LibraryMirror> seenLibrarySet = new Set<LibraryMirror>();
|
| + Queue<LibraryDependencyMirror> pendingExports =
|
| + new Queue<LibraryDependencyMirror>();
|
| +
|
| + seenLibrarySet.add(library);
|
| + pendingExports.addAll(library.libraryDependencies.where(isExport));
|
| +
|
| + while (!pendingExports.isEmpty) {
|
| + LibraryDependencyMirror export = pendingExports.removeFirst();
|
| + exports.add(export);
|
| + LibraryMirror target = export.targetLibrary;
|
| + if (!seenLibrarySet.contains(target)) {
|
| + pendingExports.addAll(target.libraryDependencies.where(isExport));
|
| + }
|
| + }
|
| + return exports;
|
| +}
|
|
|