OLD | NEW |
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, 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 analyzer.test.src.summary.resynthesize_kernel_test; | 5 library analyzer.test.src.summary.resynthesize_kernel_test; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 | 8 |
9 import 'package:analyzer/file_system/file_system.dart'; | 9 import 'package:analyzer/file_system/file_system.dart'; |
10 import 'package:analyzer/file_system/memory_file_system.dart'; | 10 import 'package:analyzer/file_system/memory_file_system.dart'; |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 }); | 80 }); |
81 | 81 |
82 var uriTranslator = | 82 var uriTranslator = |
83 new UriTranslatorImpl(dartLibraries, {}, Packages.noPackages); | 83 new UriTranslatorImpl(dartLibraries, {}, Packages.noPackages); |
84 var options = new ProcessedOptions(new CompilerOptions() | 84 var options = new ProcessedOptions(new CompilerOptions() |
85 ..target = new NoneTarget(new TargetFlags(strongMode: isStrongMode)) | 85 ..target = new NoneTarget(new TargetFlags(strongMode: isStrongMode)) |
86 ..reportMessages = false | 86 ..reportMessages = false |
87 ..logger = new PerformanceLog(null) | 87 ..logger = new PerformanceLog(null) |
88 ..fileSystem = new _FileSystemAdaptor(resourceProvider) | 88 ..fileSystem = new _FileSystemAdaptor(resourceProvider) |
89 ..byteStore = new MemoryByteStore()); | 89 ..byteStore = new MemoryByteStore()); |
90 var driver = new KernelDriver(options.logger, options.fileSystem, | 90 var driver = new KernelDriver(options, uriTranslator); |
91 options.byteStore, uriTranslator, options); | |
92 | 91 |
93 KernelResult kernelResult = await driver.getKernel(testUri); | 92 KernelResult kernelResult = await driver.getKernel(testUri); |
94 | 93 |
95 var libraryMap = <String, kernel.Library>{}; | 94 var libraryMap = <String, kernel.Library>{}; |
96 for (var cycleResult in kernelResult.results) { | 95 for (var cycleResult in kernelResult.results) { |
97 for (var library in cycleResult.kernelLibraries) { | 96 for (var library in cycleResult.kernelLibraries) { |
98 String uriStr = library.importUri.toString(); | 97 String uriStr = library.importUri.toString(); |
99 libraryMap[uriStr] = library; | 98 libraryMap[uriStr] = library; |
100 } | 99 } |
101 } | 100 } |
(...skipping 1018 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1120 @override | 1119 @override |
1121 Future<List<int>> readAsBytes() async { | 1120 Future<List<int>> readAsBytes() async { |
1122 return file.readAsBytesSync(); | 1121 return file.readAsBytesSync(); |
1123 } | 1122 } |
1124 | 1123 |
1125 @override | 1124 @override |
1126 Future<String> readAsString() async { | 1125 Future<String> readAsString() async { |
1127 return file.readAsStringSync(); | 1126 return file.readAsStringSync(); |
1128 } | 1127 } |
1129 } | 1128 } |
OLD | NEW |