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 everything reachable from a [MirrorSystem] can be accessed. | 5 // Test that everything reachable from a [MirrorSystem] can be accessed. |
6 | 6 |
7 library test.mirrors.reader; | 7 library test.mirrors.reader; |
8 | 8 |
9 import "dart:mirrors" hide SourceLocation; | 9 import "dart:mirrors" hide SourceLocation; |
10 | 10 |
11 import "package:async_helper/async_helper.dart"; | 11 import "package:async_helper/async_helper.dart"; |
12 | 12 |
13 import "mirrors_test_helper.dart"; | 13 import "mirrors_test_helper.dart"; |
14 import "../../../lib/mirrors/mirrors_reader.dart"; | 14 import "../../../lib/mirrors/mirrors_reader.dart"; |
15 import "package:compiler/src/util/util.dart"; | 15 import "package:compiler/implementation/util/util.dart"; |
16 import "package:compiler/src/mirrors/dart2js_mirrors.dart"; | 16 import "package:compiler/implementation/mirrors/dart2js_mirrors.dart"; |
17 import "package:compiler/src/mirrors/source_mirrors.dart"; | 17 import "package:compiler/implementation/mirrors/source_mirrors.dart"; |
18 | 18 |
19 class SourceMirrorsReader extends MirrorsReader { | 19 class SourceMirrorsReader extends MirrorsReader { |
20 final Dart2JsMirrorSystem mirrorSystem; | 20 final Dart2JsMirrorSystem mirrorSystem; |
21 | 21 |
22 SourceMirrorsReader(this.mirrorSystem, | 22 SourceMirrorsReader(this.mirrorSystem, |
23 {bool verbose: false, bool includeStackTrace: false}) | 23 {bool verbose: false, bool includeStackTrace: false}) |
24 : super(verbose: verbose, includeStackTrace: includeStackTrace); | 24 : super(verbose: verbose, includeStackTrace: includeStackTrace); |
25 | 25 |
26 evaluate(f()) { | 26 evaluate(f()) { |
27 try { | 27 try { |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 | 132 |
133 main(List<String> arguments) { | 133 main(List<String> arguments) { |
134 asyncTest(() => analyzeUri(Uri.parse('dart:core')). | 134 asyncTest(() => analyzeUri(Uri.parse('dart:core')). |
135 then((MirrorSystem mirrors) { | 135 then((MirrorSystem mirrors) { |
136 MirrorsReader reader = new SourceMirrorsReader(mirrors, | 136 MirrorsReader reader = new SourceMirrorsReader(mirrors, |
137 verbose: arguments.contains('-v'), | 137 verbose: arguments.contains('-v'), |
138 includeStackTrace: arguments.contains('-s')); | 138 includeStackTrace: arguments.contains('-s')); |
139 reader.checkMirrorSystem(mirrors); | 139 reader.checkMirrorSystem(mirrors); |
140 })); | 140 })); |
141 } | 141 } |
OLD | NEW |