| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 library reflective_tests; | 5 library reflective_tests; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 | |
| 9 @MirrorsUsed(metaTargets: 'ReflectiveTestCase') | |
| 10 import 'dart:mirrors'; | 8 import 'dart:mirrors'; |
| 11 | 9 |
| 12 import 'package:unittest/unittest.dart'; | 10 import 'package:unittest/unittest.dart'; |
| 13 | 11 |
| 14 | 12 |
| 15 /** | 13 /** |
| 16 * A marker annotation used to instruct dart2js to keep reflection information | 14 * A marker annotation used to instruct dart2js to keep reflection information |
| 17 * for the annotated classes. | 15 * for the annotated classes. |
| 18 */ | 16 */ |
| 19 class ReflectiveTestCase { | 17 class ReflectiveTestCase { |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 try { | 78 try { |
| 81 invocationResult = instanceMirror.invoke(symbol, []).reflectee; | 79 invocationResult = instanceMirror.invoke(symbol, []).reflectee; |
| 82 } on NoSuchMethodError catch (e) { | 80 } on NoSuchMethodError catch (e) { |
| 83 } | 81 } |
| 84 if (invocationResult is Future) { | 82 if (invocationResult is Future) { |
| 85 return invocationResult; | 83 return invocationResult; |
| 86 } else { | 84 } else { |
| 87 return new Future.value(invocationResult); | 85 return new Future.value(invocationResult); |
| 88 } | 86 } |
| 89 } | 87 } |
| OLD | NEW |