| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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:collection'; | 6 import 'dart:collection'; |
| 7 import 'dart:core'; | 7 import 'dart:core'; |
| 8 | 8 |
| 9 import 'package:analyzer/dart/ast/ast.dart'; | 9 import 'package:analyzer/dart/ast/ast.dart'; |
| 10 import 'package:analyzer/dart/ast/token.dart'; | 10 import 'package:analyzer/dart/ast/token.dart'; |
| (...skipping 723 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 734 uriToNode[uri] = node; | 734 uriToNode[uri] = node; |
| 735 } | 735 } |
| 736 } | 736 } |
| 737 Set<String> libraryUris = uriToNode.keys.toSet(); | 737 Set<String> libraryUris = uriToNode.keys.toSet(); |
| 738 // Perform linking. | 738 // Perform linking. |
| 739 Map<String, LinkedLibraryBuilder> linkedLibraries = | 739 Map<String, LinkedLibraryBuilder> linkedLibraries = |
| 740 link(libraryUris, (String uri) { | 740 link(libraryUris, (String uri) { |
| 741 return store.linkedMap[uri]; | 741 return store.linkedMap[uri]; |
| 742 }, (String uri) { | 742 }, (String uri) { |
| 743 return store.unlinkedMap[uri]; | 743 return store.unlinkedMap[uri]; |
| 744 }, (String name) { |
| 745 // TODO(scheglov) decide how to use declared variables in Pub |
| 746 return null; |
| 744 }, strong); | 747 }, strong); |
| 745 // Assemble linked bundles and put them into the store. | 748 // Assemble linked bundles and put them into the store. |
| 746 for (_LinkedNode node in scc) { | 749 for (_LinkedNode node in scc) { |
| 747 PackageBundleAssembler assembler = new PackageBundleAssembler(); | 750 PackageBundleAssembler assembler = new PackageBundleAssembler(); |
| 748 linkedLibraries.forEach((uri, linkedLibrary) { | 751 linkedLibraries.forEach((uri, linkedLibrary) { |
| 749 if (identical(uriToNode[uri], node)) { | 752 if (identical(uriToNode[uri], node)) { |
| 750 assembler.addLinkedLibrary(uri, linkedLibrary); | 753 assembler.addLinkedLibrary(uri, linkedLibrary); |
| 751 } | 754 } |
| 752 }); | 755 }); |
| 753 List<int> bytes = assembler.assemble().toBuffer(); | 756 List<int> bytes = assembler.assemble().toBuffer(); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 775 } | 778 } |
| 776 | 779 |
| 777 /** | 780 /** |
| 778 * Check whether the given `package:` [uri] is listed in the package map. | 781 * Check whether the given `package:` [uri] is listed in the package map. |
| 779 */ | 782 */ |
| 780 bool isListed(String uri) { | 783 bool isListed(String uri) { |
| 781 String package = PubSummaryManager.getPackageName(uri); | 784 String package = PubSummaryManager.getPackageName(uri); |
| 782 return names.contains(package); | 785 return names.contains(package); |
| 783 } | 786 } |
| 784 } | 787 } |
| OLD | NEW |