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

Unified Diff: pkg/docgen/lib/docgen.dart

Issue 64713006: Filter out statics when adding inherited members (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 1 month 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/docgen/lib/docgen.dart
diff --git a/pkg/docgen/lib/docgen.dart b/pkg/docgen/lib/docgen.dart
index eafbc1ce77b4eac0680487a8934b64445a9bb78f..d1251ae6897a1e36e69ac91b2d8a38539bc0969f 100644
--- a/pkg/docgen/lib/docgen.dart
+++ b/pkg/docgen/lib/docgen.dart
@@ -897,7 +897,7 @@ class Class extends Indexable {
/// the superclass.
void addInherited(Class superclass) {
inheritedVariables.addAll(superclass.inheritedVariables);
- inheritedVariables.addAll(superclass.variables);
+ inheritedVariables.addAll(_filterStatics(superclass.variables));
inheritedMethods.addInherited(superclass);
}
@@ -1190,13 +1190,13 @@ class MethodGroup {
void addInherited(Class parent) {
setters.addAll(parent.inheritedMethods.setters);
- setters.addAll(parent.methods.setters);
+ setters.addAll(_filterStatics(parent.methods.setters));
getters.addAll(parent.inheritedMethods.getters);
- getters.addAll(parent.methods.getters);
+ getters.addAll(_filterStatics(parent.methods.getters));
operators.addAll(parent.inheritedMethods.operators);
- operators.addAll(parent.methods.operators);
+ operators.addAll(_filterStatics(parent.methods.operators));
regularMethods.addAll(parent.inheritedMethods.regularMethods);
- regularMethods.addAll(parent.methods.regularMethods);
+ regularMethods.addAll(_filterStatics(parent.methods.regularMethods));
}
Map toMap() => {
@@ -1332,3 +1332,14 @@ String docName(DeclarationMirror m) {
if (m.simpleName == '') return docName(owner);
return docName(owner) + '.' + m.simpleName;
}
+
+/// Remove statics from the map of inherited items before adding them.
+Map _filterStatics(Map items) {
+ var result = {};
+ items.forEach((name, item) {
+ if (!item.isStatic) {
+ result[name] = item;
+ }
+ });
+ return result;
+}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698