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