Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1202)

Unified Diff: pkg/docgen/lib/src/models/model_helpers.dart

Issue 929353004: Handle mutually recursive re-exports in dartdocgen (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/docgen/lib/src/models/library.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/docgen/lib/src/models/model_helpers.dart
diff --git a/pkg/docgen/lib/src/models/model_helpers.dart b/pkg/docgen/lib/src/models/model_helpers.dart
index 3c4c430464ed9539560eca995d7c22cd7efff68f..f962e757b46328f2ca0532c20a261678c8180e44 100644
--- a/pkg/docgen/lib/src/models/model_helpers.dart
+++ b/pkg/docgen/lib/src/models/model_helpers.dart
@@ -217,8 +217,9 @@ Map addAll(Map map, Iterable<DeclarationMirror> mirrors) {
/// values of which point to a map of exported name identifiers with values
/// corresponding to the actual DeclarationMirror.
Map<String, Map<String, DeclarationMirror>> calcExportedItems(
- LibrarySourceMirror library) {
+ LibrarySourceMirror library, Map visited) {
tjblasi 2015/02/19 00:52:55 It seems a bit strange that this is a required par
Alan Knight 2015/02/19 01:07:04 We can't know in advance if it's recursive or not.
var exports = {};
+ visited[library] = exports;
exports['classes'] = new SplayTreeMap();
exports['methods'] = new SplayTreeMap();
exports['variables'] = new SplayTreeMap();
@@ -226,7 +227,8 @@ Map<String, Map<String, DeclarationMirror>> calcExportedItems(
// Determine the classes, variables and methods that are exported for a
// specific dependency.
void _populateExports(LibraryDependencyMirror export, bool showExport) {
- var transitiveExports = calcExportedItems(export.targetLibrary);
+ if (visited[export.targetLibrary] != null) return;
+ var transitiveExports = calcExportedItems(export.targetLibrary, visited);
exports['classes'].addAll(transitiveExports['classes']);
exports['methods'].addAll(transitiveExports['methods']);
exports['variables'].addAll(transitiveExports['variables']);
« no previous file with comments | « pkg/docgen/lib/src/models/library.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698