| 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 import 'dart:io'; | 5 import 'dart:io'; |
| 6 import 'dart:async'; | 6 import 'dart:async'; |
| 7 import 'dart:mirrors'; | 7 import '../../../../sdk/lib/_internal/compiler/implementation/mirrors/source_mir
rors.dart'; |
| 8 | |
| 9 import '../../../../sdk/lib/_internal/compiler/implementation/mirrors/source_mir
rors.dart' as source_mirrors; | |
| 10 import '../../../../sdk/lib/_internal/compiler/implementation/mirrors/analyze.da
rt' as source_mirrors; | 8 import '../../../../sdk/lib/_internal/compiler/implementation/mirrors/analyze.da
rt' as source_mirrors; |
| 11 import '../../../../sdk/lib/_internal/compiler/implementation/source_file_provid
er.dart'; | 9 import '../../../../sdk/lib/_internal/compiler/implementation/source_file_provid
er.dart'; |
| 12 | 10 |
| 13 TypeMirror createInstantiation(source_mirrors.TypeMirror type, | 11 TypeMirror createInstantiation(TypeSourceMirror type, |
| 14 List<TypeMirror> typeArguments) { | 12 List<TypeMirror> typeArguments) { |
| 15 return type.createInstantiation(typeArguments); | 13 return type.createInstantiation(typeArguments); |
| 16 } | 14 } |
| 17 | 15 |
| 18 Future<MirrorSystem> analyze(String test) { | 16 Future<MirrorSystem> analyze(String test) { |
| 19 Uri repository = Platform.script.resolve('../../../../'); | 17 Uri repository = Platform.script.resolve('../../../../'); |
| 20 Uri testUri = repository.resolve('tests/lib/mirrors/$test'); | 18 Uri testUri = repository.resolve('tests/lib/mirrors/$test'); |
| 21 Uri libraryRoot = repository.resolve('sdk/'); | 19 Uri libraryRoot = repository.resolve('sdk/'); |
| 22 Uri packageRoot = Uri.base.resolve('${Platform.packageRoot}/'); | 20 Uri packageRoot = Uri.base.resolve('${Platform.packageRoot}/'); |
| 23 var provider = new CompilerSourceFileProvider(); | 21 var provider = new CompilerSourceFileProvider(); |
| 24 var handler = new FormattingDiagnosticHandler(provider); | 22 var handler = new FormattingDiagnosticHandler(provider); |
| 25 return source_mirrors.analyze( | 23 return source_mirrors.analyze( |
| 26 [testUri], | 24 [testUri], |
| 27 libraryRoot, | 25 libraryRoot, |
| 28 packageRoot, | 26 packageRoot, |
| 29 provider, | 27 provider, |
| 30 handler); | 28 handler); |
| 31 } | 29 } |
| OLD | NEW |