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 /** | 5 /** |
6 * This library is capable of producing linked summaries from unlinked | 6 * This library is capable of producing linked summaries from unlinked |
7 * ones (or prelinked ones). It functions by building a miniature | 7 * ones (or prelinked ones). It functions by building a miniature |
8 * element model to represent the contents of the summaries, and then | 8 * element model to represent the contents of the summaries, and then |
9 * scanning the element model to gather linked information and adding | 9 * scanning the element model to gather linked information and adding |
10 * it to the summary data structures. | 10 * it to the summary data structures. |
(...skipping 3533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3544 * [library], return its index. Otherwise add a new dependency to table and | 3544 * [library], return its index. Otherwise add a new dependency to table and |
3545 * return its index. | 3545 * return its index. |
3546 */ | 3546 */ |
3547 int addDependency(LibraryElementForLink library) { | 3547 int addDependency(LibraryElementForLink library) { |
3548 for (int i = 0; i < _linkedLibrary.dependencies.length; i++) { | 3548 for (int i = 0; i < _linkedLibrary.dependencies.length; i++) { |
3549 if (identical(_getDependency(i), library)) { | 3549 if (identical(_getDependency(i), library)) { |
3550 return i; | 3550 return i; |
3551 } | 3551 } |
3552 } | 3552 } |
3553 int result = _linkedLibrary.dependencies.length; | 3553 int result = _linkedLibrary.dependencies.length; |
| 3554 Uri libraryUri = library._absoluteUri; |
| 3555 List<String> partsRelativeToDependency = |
| 3556 library.definingUnlinkedUnit.publicNamespace.parts; |
| 3557 List<String> partsRelativeToLibraryBeingLinked = partsRelativeToDependency |
| 3558 .map((partUri) => |
| 3559 resolveRelativeUri(libraryUri, Uri.parse(partUri)).toString()) |
| 3560 .toList(); |
3554 _linkedLibrary.dependencies.add(new LinkedDependencyBuilder( | 3561 _linkedLibrary.dependencies.add(new LinkedDependencyBuilder( |
3555 parts: library.definingUnlinkedUnit.publicNamespace.parts, | 3562 parts: partsRelativeToLibraryBeingLinked, uri: libraryUri.toString())); |
3556 uri: library._absoluteUri.toString())); | |
3557 _dependencies.add(library); | 3563 _dependencies.add(library); |
3558 return result; | 3564 return result; |
3559 } | 3565 } |
3560 | 3566 |
3561 /** | 3567 /** |
3562 * Perform type inference and const cycle detection on this library. | 3568 * Perform type inference and const cycle detection on this library. |
3563 */ | 3569 */ |
3564 void link() { | 3570 void link() { |
3565 for (CompilationUnitElementInBuildUnit unit in units) { | 3571 for (CompilationUnitElementInBuildUnit unit in units) { |
3566 unit.link(); | 3572 unit.link(); |
(...skipping 1529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5096 * there are no type parameters in scope. | 5102 * there are no type parameters in scope. |
5097 */ | 5103 */ |
5098 TypeParameterizedElementMixin get _typeParameterContext; | 5104 TypeParameterizedElementMixin get _typeParameterContext; |
5099 | 5105 |
5100 @override | 5106 @override |
5101 noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation); | 5107 noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation); |
5102 | 5108 |
5103 @override | 5109 @override |
5104 String toString() => '$enclosingElement.$name'; | 5110 String toString() => '$enclosingElement.$name'; |
5105 } | 5111 } |
OLD | NEW |