| 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..ac4791f311f892810973bf3ed1fff24807d91644 100644
|
| --- a/pkg/docgen/lib/src/models/annotation.dart
|
| +++ b/pkg/docgen/lib/src/models/annotation.dart
|
| @@ -21,8 +21,26 @@ class Annotation extends MirrorBased {
|
|
|
| Annotation(InstanceMirror originalMirror, this.owningLibrary)
|
| : mirror = originalMirror.type {
|
| - parameters = dart2js_util.variablesOf(originalMirror.type.declarations)
|
| - .where((e) => e.isFinal)
|
| + var curMirror = originalMirror.type;
|
| + Map<Symbol, DeclarationMirror> allDeclarations =
|
| + new Map.from(curMirror.declarations);
|
| + // This method assumes that our users aren't creating deep inheritance
|
| + // chains of custom annotation inheritance. If this is not the case,
|
| + // re-write this section for performance.
|
| + while (curMirror.superclass != null &&
|
| + curMirror.superclass.simpleName.toString() != 'Object') {
|
| + allDeclarations.addAll(curMirror.superclass.declarations);
|
| + curMirror = curMirror.superclass;
|
| + }
|
| +
|
| + // TODO(efortuna): Some originalMirrors, such as the
|
| + // Dart2JsMapConstantMirror and Dart2JsListConstantMirror don't have a
|
| + // reflectee field, but we want the value of the parameter from them.
|
| + // Gross workaround is to assemble the object manually.
|
| + // See issue 18346.
|
| + parameters = dart2js_util.variablesOf(allDeclarations)
|
| + .where((e) => e.isFinal &&
|
| + originalMirror.getField(e.simpleName).hasReflectee)
|
| .map((e) => originalMirror.getField(e.simpleName).reflectee)
|
| .where((e) => e != null)
|
| .toList();
|
|
|