Chromium Code Reviews| Index: pkg/analyzer/test/reflective_tests.dart |
| diff --git a/pkg/analyzer/test/reflective_tests.dart b/pkg/analyzer/test/reflective_tests.dart |
| index 24c36cb4fbd419dd8fc03faff9452b419c0ab28a..970743db783445e30337dedb20d0db4b9908955f 100644 |
| --- a/pkg/analyzer/test/reflective_tests.dart |
| +++ b/pkg/analyzer/test/reflective_tests.dart |
| @@ -73,14 +73,15 @@ void runReflectiveTests(Type type) { |
| Future _invokeSymbolIfExists(InstanceMirror instanceMirror, Symbol symbol) { |
| var invocationResult = null; |
| + InstanceMirror closure; |
| try { |
| - invocationResult = instanceMirror.invoke(symbol, []).reflectee; |
| + closure = instanceMirror.getField(symbol); |
|
Jennifer Messerly
2016/01/19 23:53:54
Basically, we get the tearoff:
https://api.dartlan
|
| } on NoSuchMethodError {} |
| - if (invocationResult is Future) { |
| - return invocationResult; |
| - } else { |
| - return new Future.value(invocationResult); |
| + |
| + if (closure is ClosureMirror) { |
| + invocationResult = closure.apply([]).reflectee; |
| } |
| + return new Future.value(invocationResult); |
| } |
| /** |