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

Unified Diff: pkg/docgen/lib/src/models/variable.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: 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
Index: pkg/docgen/lib/src/models/variable.dart
diff --git a/pkg/docgen/lib/src/models/variable.dart b/pkg/docgen/lib/src/models/variable.dart
index f89bef156048a00bdc084c9b4a24a81401e67668..0ecb0dea828e33f5002834826280cd4753ef678d 100644
--- a/pkg/docgen/lib/src/models/variable.dart
+++ b/pkg/docgen/lib/src/models/variable.dart
@@ -16,32 +16,27 @@ import 'owned_indexable.dart';
/// A class containing properties of a Dart variable.
-class Variable extends OwnedIndexable {
-
- bool isFinal;
- bool isStatic;
- bool isConst;
- DocGenType type;
- String _variableName;
-
- factory Variable(String variableName, VariableMirror mirror,
- Indexable owner) {
+class Variable extends OwnedIndexable<VariableMirror> {
+ final bool isFinal;
+ final bool isStatic;
+ final bool isConst;
+ final DocGenType type;
+ final String name;
+
+ factory Variable(String name, VariableMirror mirror, Indexable owner) {
var variable = getDocgenObject(mirror);
if (variable is DummyMirror) {
- return new Variable._(variableName, mirror, owner);
+ return new Variable._(name, mirror, owner);
}
return variable;
}
- Variable._(this._variableName, VariableMirror mirror, Indexable owner) :
- super(mirror, owner) {
- isFinal = mirror.isFinal;
- isStatic = mirror.isStatic;
- isConst = mirror.isConst;
- type = new DocGenType(mirror.type, owner.owningLibrary);
- }
-
- String get name => _variableName;
kevmoo 2014/04/20 21:34:54 Replaced private field + getter into public field
+ Variable._(this.name, VariableMirror mirror, Indexable owner)
+ : isFinal = mirror.isFinal,
+ isStatic = mirror.isStatic,
+ isConst = mirror.isConst,
+ type = new DocGenType(mirror.type, owner.owningLibrary),
+ super(mirror, owner);
/// Generates a map describing the [Variable] object.
Map toMap() => {
@@ -57,7 +52,7 @@ class Variable extends OwnedIndexable {
String get typeName => 'property';
- get comment {
+ String get comment {
if (commentField != null) return commentField;
if (owner is Class) {
(owner as Class).ensureComments();

Powered by Google App Engine
This is Rietveld 408576698