OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 /** | 5 /** |
6 * [CompilerTask] for loading libraries and setting up the import/export scopes. | 6 * [CompilerTask] for loading libraries and setting up the import/export scopes. |
7 */ | 7 */ |
8 abstract class LibraryLoader extends CompilerTask { | 8 abstract class LibraryLoader extends CompilerTask { |
9 LibraryLoader(Compiler compiler) : super(compiler); | 9 LibraryLoader(Compiler compiler) : super(compiler); |
10 | 10 |
(...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
494 dependencies.prepend(new ExportLink(export, exportingLibraryNode)); | 494 dependencies.prepend(new ExportLink(export, exportingLibraryNode)); |
495 } | 495 } |
496 | 496 |
497 /** | 497 /** |
498 * Registers all non-private locally declared members of the library of this | 498 * Registers all non-private locally declared members of the library of this |
499 * node to be exported. This forms the basis for the work-list computation of | 499 * node to be exported. This forms the basis for the work-list computation of |
500 * the export scopes performed in [LibraryDependencyHandler.computeExports]. | 500 * the export scopes performed in [LibraryDependencyHandler.computeExports]. |
501 */ | 501 */ |
502 void registerInitialExports() { | 502 void registerInitialExports() { |
503 pendingExportSet.addAll( | 503 pendingExportSet.addAll( |
504 library.localScope.getValues().filter((Element element) { | 504 library.localScope.values.filter((Element element) { |
505 // At this point [localScope] only contains members so we don't need | 505 // At this point [localScope] only contains members so we don't need |
506 // to check for foreign or prefix elements. | 506 // to check for foreign or prefix elements. |
507 return !element.name.isPrivate(); | 507 return !element.name.isPrivate(); |
508 })); | 508 })); |
509 } | 509 } |
510 | 510 |
511 /** | 511 /** |
512 * Registers the compute export scope with the node library. | 512 * Registers the compute export scope with the node library. |
513 */ | 513 */ |
514 void registerExports() { | 514 void registerExports() { |
515 library.setExports(exportScope.getValues()); | 515 library.setExports(exportScope.values); |
516 } | 516 } |
517 | 517 |
518 /** | 518 /** |
519 * Registers the imports of the node library. | 519 * Registers the imports of the node library. |
520 */ | 520 */ |
521 void registerImports(Compiler compiler) { | 521 void registerImports(Compiler compiler) { |
522 for (ImportLink link in imports) { | 522 for (ImportLink link in imports) { |
523 link.importLibrary(compiler, library); | 523 link.importLibrary(compiler, library); |
524 } | 524 } |
525 } | 525 } |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
685 } | 685 } |
686 | 686 |
687 /** | 687 /** |
688 * Registers all top-level entities of [library] as starting point for the | 688 * Registers all top-level entities of [library] as starting point for the |
689 * fixed-point computation of the import/export scopes. | 689 * fixed-point computation of the import/export scopes. |
690 */ | 690 */ |
691 void registerLibraryExports(LibraryElement library) { | 691 void registerLibraryExports(LibraryElement library) { |
692 nodeMap[library].registerInitialExports(); | 692 nodeMap[library].registerInitialExports(); |
693 } | 693 } |
694 } | 694 } |
OLD | NEW |