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 import 'dart:async'; | 5 import 'dart:async'; |
6 import 'dart:io'; | 6 import 'dart:io'; |
7 | 7 |
8 import 'package:front_end/file_system.dart'; | 8 import 'package:front_end/file_system.dart'; |
9 import 'package:front_end/incremental_kernel_generator.dart'; | 9 import 'package:front_end/incremental_kernel_generator.dart'; |
10 import 'package:front_end/src/base/api_signature.dart'; | 10 import 'package:front_end/src/base/api_signature.dart'; |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 /// TODO(scheglov) Remove/replace this when Kernel has export scopes. | 239 /// TODO(scheglov) Remove/replace this when Kernel has export scopes. |
240 void _computeExportScopes(DillTarget dillTarget, | 240 void _computeExportScopes(DillTarget dillTarget, |
241 Map<Uri, FileState> uriToFile, List<DillLibraryBuilder> libraries) { | 241 Map<Uri, FileState> uriToFile, List<DillLibraryBuilder> libraries) { |
242 bool wasChanged = false; | 242 bool wasChanged = false; |
243 do { | 243 do { |
244 wasChanged = false; | 244 wasChanged = false; |
245 for (DillLibraryBuilder library in libraries) { | 245 for (DillLibraryBuilder library in libraries) { |
246 FileState file = uriToFile[library.uri]; | 246 FileState file = uriToFile[library.uri]; |
247 for (NamespaceExport export in file.exports) { | 247 for (NamespaceExport export in file.exports) { |
248 DillLibraryBuilder exportedLibrary = | 248 DillLibraryBuilder exportedLibrary = |
249 dillTarget.loader.read(export.library.uri); | 249 dillTarget.loader.read(export.library.uri, -1, accessor: library); |
250 if (exportedLibrary != null) { | 250 if (exportedLibrary != null) { |
251 exportedLibrary.exports.forEach((name, member) { | 251 exportedLibrary.exports.forEach((name, member) { |
252 if (export.isExposed(name) && | 252 if (export.isExposed(name) && |
253 library.addToExportScope(name, member)) { | 253 library.addToExportScope(name, member)) { |
254 wasChanged = true; | 254 wasChanged = true; |
255 } | 255 } |
256 }); | 256 }); |
257 } else { | 257 } else { |
258 // TODO(scheglov) How to handle this? | 258 // TODO(scheglov) How to handle this? |
259 } | 259 } |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
302 /// TODO(scheglov) Use API signatures. | 302 /// TODO(scheglov) Use API signatures. |
303 /// TODO(scheglov) Or use tree shaking and compute signatures of outlines. | 303 /// TODO(scheglov) Or use tree shaking and compute signatures of outlines. |
304 final String signature; | 304 final String signature; |
305 | 305 |
306 /// Kernel libraries for libraries in the [cycle]. Bodies of dependencies | 306 /// Kernel libraries for libraries in the [cycle]. Bodies of dependencies |
307 /// are not included, but but references to those dependencies are included. | 307 /// are not included, but but references to those dependencies are included. |
308 final List<Library> kernelLibraries; | 308 final List<Library> kernelLibraries; |
309 | 309 |
310 _LibraryCycleResult(this.cycle, this.signature, this.kernelLibraries); | 310 _LibraryCycleResult(this.cycle, this.signature, this.kernelLibraries); |
311 } | 311 } |
OLD | NEW |