@@ -43,7 +43,8 @@ dynamic instantiateAnnotation(ElementAnnotation annotation) {
43
43
return _createFromConstructor (element, annotationObject);
44
44
}
45
45
46
- var valueDeclaration = _getDeclMirrorFromType (annotation.constantValue.type);
46
+ var valueDeclaration =
47
+ _getDeclarationMirrorFromType (annotation.constantValue.type);
47
48
48
49
throw "No clue how to create $valueDeclaration of type ${valueDeclaration .runtimeType }" ;
49
50
}
@@ -77,7 +78,8 @@ dynamic _getValue(DartObject object, TypeProvider typeProvider) {
77
78
var typeData = object.toTypeValue ();
78
79
79
80
if (typeData is InterfaceType ) {
80
- var declarationMirror = _getDeclMirrorFromType (typeData) as ClassMirror ;
81
+ var declarationMirror =
82
+ _getDeclarationMirrorFromType (typeData) as ClassMirror ;
81
83
82
84
return declarationMirror.reflectedType;
83
85
}
@@ -134,11 +136,11 @@ final _cannotCreate = new Object();
134
136
135
137
dynamic _createFromConstructor (
136
138
ConstructorElementImpl ctor, DartObjectImpl obj) {
137
- var ctorDecl = ctor.computeNode ();
139
+ var ctorDeclaration = ctor.computeNode ();
138
140
139
141
var positionalArgs = [];
140
142
var namedArgs = < Symbol , dynamic > {};
141
- for (var p in ctorDecl .parameters.parameterElements) {
143
+ for (var p in ctorDeclaration .parameters.parameterElements) {
142
144
var paramName = p.name;
143
145
String fieldName;
144
146
if (p is FieldFormalParameterElement ) {
@@ -177,22 +179,22 @@ dynamic _createFromConstructor(
177
179
}
178
180
179
181
Symbol ctorName;
180
- if (ctorDecl .name == null ) {
182
+ if (ctorDeclaration .name == null ) {
181
183
ctorName = const Symbol ('' );
182
184
} else {
183
- ctorName = new Symbol (ctorDecl .name.name);
185
+ ctorName = new Symbol (ctorDeclaration .name.name);
184
186
}
185
187
186
- var declMirror =
187
- _getDeclMirrorFromType (ctor.enclosingElement.type) as ClassMirror ;
188
+ var declarationMirror =
189
+ _getDeclarationMirrorFromType (ctor.enclosingElement.type) as ClassMirror ;
188
190
189
191
// figure out which ctor was used!
190
192
var instanceMirror =
191
- declMirror .newInstance (ctorName, positionalArgs, namedArgs);
193
+ declarationMirror .newInstance (ctorName, positionalArgs, namedArgs);
192
194
return instanceMirror.reflectee;
193
195
}
194
196
195
- DeclarationMirror _getDeclMirrorFromType (InterfaceType type) {
197
+ DeclarationMirror _getDeclarationMirrorFromType (InterfaceType type) {
196
198
var system = currentMirrorSystem ();
197
199
198
200
// find library
0 commit comments