OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 /// Test that the @MirrorsUsed annotation suppress hints and that only | 5 /// Test that the @MirrorsUsed annotation suppress hints and that only |
6 /// requested elements are retained for reflection. | 6 /// requested elements are retained for reflection. |
7 library dart2js.test.mirrors_used_test; | 7 library dart2js.test.mirrors_used_test; |
8 | 8 |
9 import 'package:expect/expect.dart'; | 9 import 'package:expect/expect.dart'; |
10 import "package:async_helper/async_helper.dart"; | 10 import "package:async_helper/async_helper.dart"; |
11 | 11 |
12 import 'memory_compiler.dart' show | 12 import 'memory_compiler.dart' show |
13 compilerFor; | 13 compilerFor; |
14 | 14 |
15 import 'package:compiler/src/apiimpl.dart' show | 15 import 'package:compiler/implementation/apiimpl.dart' show |
16 Compiler; | 16 Compiler; |
17 | 17 |
18 import 'package:compiler/src/constants/values.dart' show | 18 import 'package:compiler/implementation/constants/values.dart' show |
19 ConstantValue, | 19 ConstantValue, |
20 TypeConstantValue; | 20 TypeConstantValue; |
21 | 21 |
22 import 'package:compiler/src/elements/elements.dart' show | 22 import 'package:compiler/implementation/elements/elements.dart' show |
23 Element, | 23 Element, |
24 Elements; | 24 Elements; |
25 | 25 |
26 import 'package:compiler/src/js_backend/js_backend.dart' show | 26 import 'package:compiler/implementation/js_backend/js_backend.dart' show |
27 JavaScriptBackend; | 27 JavaScriptBackend; |
28 | 28 |
29 void expectOnlyVerboseInfo(Uri uri, int begin, int end, String message, kind) { | 29 void expectOnlyVerboseInfo(Uri uri, int begin, int end, String message, kind) { |
30 if (kind.name == 'verbose info') { | 30 if (kind.name == 'verbose info') { |
31 print(message); | 31 print(message); |
32 return; | 32 return; |
33 } | 33 } |
34 if (message.contains('methods retained for use by dart:mirrors out of')) { | 34 if (message.contains('methods retained for use by dart:mirrors out of')) { |
35 print(message); | 35 print(message); |
36 return; | 36 return; |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 library lib; | 165 library lib; |
166 | 166 |
167 import 'dart:mirrors'; | 167 import 'dart:mirrors'; |
168 | 168 |
169 useReflect(type) { | 169 useReflect(type) { |
170 print(new Symbol('Foo')); | 170 print(new Symbol('Foo')); |
171 print(MirrorSystem.getName(reflectClass(type).owner.qualifiedName)); | 171 print(MirrorSystem.getName(reflectClass(type).owner.qualifiedName)); |
172 } | 172 } |
173 """, | 173 """, |
174 }; | 174 }; |
OLD | NEW |