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

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

Issue 243483005: pkg/docgen: fixed type references within typedef doc comments (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: removed indent-json Created 6 years, 8 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 | « no previous file | pkg/docgen/lib/src/models/dummy_mirror.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/docgen/lib/src/models/annotation.dart
diff --git a/pkg/docgen/lib/src/models/annotation.dart b/pkg/docgen/lib/src/models/annotation.dart
index 0cc97c6e20f37077e667136ab2648cdd5097020a..0b226a1586e3a4d77a99794480c5392aba9f3b51 100644
--- a/pkg/docgen/lib/src/models/annotation.dart
+++ b/pkg/docgen/lib/src/models/annotation.dart
@@ -13,23 +13,26 @@ import 'library.dart';
import 'mirror_based.dart';
/// Holds the name of the annotation, and its parameters.
-class Annotation extends MirrorBased {
+class Annotation extends MirrorBased<ClassMirror> {
/// The class of this annotation.
final ClassMirror mirror;
final Library owningLibrary;
- List<String> parameters;
+ final List<String> parameters;
Annotation(InstanceMirror originalMirror, this.owningLibrary)
- : mirror = originalMirror.type {
- parameters = dart2js_util.variablesOf(originalMirror.type.declarations)
- .where((e) => e.isFinal)
- .map((e) => originalMirror.getField(e.simpleName).reflectee)
- .where((e) => e != null)
- .toList();
- }
+ : mirror = originalMirror.type,
+ parameters = _createParamaters(originalMirror);
Map toMap() => {
'name': getDocgenObject(mirror, owningLibrary).docName,
'parameters': parameters
};
}
+
+List<String> _createParamaters(InstanceMirror originalMirror) {
+ return dart2js_util.variablesOf(originalMirror.type.declarations)
+ .where((e) => e.isFinal)
+ .map((e) => originalMirror.getField(e.simpleName).reflectee)
+ .where((e) => e != null)
+ .toList();
+}
« no previous file with comments | « no previous file | pkg/docgen/lib/src/models/dummy_mirror.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698