| 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;
|
| + 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();
|
|
|