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

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

Issue 63483002: Fix some users of removed mirror API. (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 | pkg/polymer/lib/src/declaration.dart » ('j') | 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..eab989360db73bf5b7ae46f65d24d6155a37f1ce 100644
--- a/pkg/docgen/lib/docgen.dart
+++ b/pkg/docgen/lib/docgen.dart
@@ -365,12 +365,23 @@ void _documentLibraries(List<LibraryMirror> libs, {bool includeSdk: false,
_writeToFile(JSON.encode(index), 'index.json');
}
+_filterMap(map, predicate) {
+ var result = new Map();
+ map.forEach((key, value) {
+ if (predicate(value)) result[key] = value;
+ });
+ return result;
+}
+
Library generateLibrary(dart2js.Dart2JsLibraryMirror library) {
_currentLibrary = library;
- var result = new Library(docName(library), _commentToHtml(library),
- _variables(library.variables),
- _methods(library.functions),
- _classes(library.classes), _isHidden(library));
+ var result = new Library(
+ docName(library),
+ _commentToHtml(library),
+ _variables(_filterMap(library.declarations, (d) => d is VariableMirror)),
+ _methods(_filterMap(library.declarations, (d) => d is MethodMirror)),
+ _classes(_filterMap(library.declarations, (d) => d is ClassMirror)),
+ _isHidden(library));
_findPackage(result, library);
logger.fine('Generated library for ${result.name}');
return result;
@@ -657,8 +668,11 @@ Class _class(ClassMirror mirror) {
var interfaces =
mirror.superinterfaces.map((interface) => _class(interface));
clazz = new Class(mirror.simpleName, superclass, _commentToHtml(mirror),
- interfaces.toList(), _variables(mirror.variables),
- _methods(mirror.methods), _annotations(mirror), _generics(mirror),
+ interfaces.toList(),
+ _variables(_filterMap(mirror.declarations, (d) => d is VariableMirror)),
+ _methods(_filterMap(mirror.declarations,
+ (d) => d is MethodMirror && !d.isConstructor)),
+ _annotations(mirror), _generics(mirror),
docName(mirror), _isHidden(mirror), docName(mirror.owner),
mirror.isAbstract);
if (superclass != null) clazz.addInherited(superclass);
« no previous file with comments | « no previous file | pkg/polymer/lib/src/declaration.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698