fix(di): allow @Inject(…) to work in dart2js and dynamic reflection

Note: We can’t write a unit test for this as our unit tests
are running in Dartium, where the error does not occur.
However, we previously had a failure in our e2e tests
in `hello_world/index_dynamic.html`
when removing the TODOs in `application.ts`.

Closes #2185
This commit is contained in:
Tobias Bosch
2015-05-27 10:28:15 -07:00
parent 608017776e
commit 4a3fd5e855
2 changed files with 4 additions and 11 deletions

View File

@ -57,8 +57,8 @@ class ReflectionCapabilities {
}
List _convertParameter(ParameterMirror p) {
var t = p.type.reflectedType;
var res = t == dynamic ? [] : [t];
var t = p.type;
var res = (!t.hasReflectedType || t.reflectedType == dynamic) ? [] : [t.reflectedType];
res.addAll(p.metadata.map((m) => m.reflectee));
return res;
}