Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(787)

Unified Diff: pkg/analyzer/lib/src/summary/resynthesize.dart

Issue 2703873002: Don't treat LinkedDependency URIs as absolute in resynthesizer.dart for backward compatibility. (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/summary/resynthesize.dart
diff --git a/pkg/analyzer/lib/src/summary/resynthesize.dart b/pkg/analyzer/lib/src/summary/resynthesize.dart
index a83505e229f0f384ed50978df6caa54a33bb357e..aeec4b4c2a5b3597d0f27363e925a5d8723297af 100644
--- a/pkg/analyzer/lib/src/summary/resynthesize.dart
+++ b/pkg/analyzer/lib/src/summary/resynthesize.dart
@@ -1083,12 +1083,15 @@ class _LibraryResynthesizer {
return <String>[referencedLibraryUri, partUri, name];
}
LinkedDependency dependency = linkedLibrary.dependencies[dependencyIndex];
- Source referencedLibrarySource =
- summaryResynthesizer.sourceFactory.forUri(dependency.uri);
+ Source referencedLibrarySource = summaryResynthesizer.sourceFactory
+ .resolveUri(librarySource, dependency.uri);
String referencedLibraryUri = referencedLibrarySource.uri.toString();
String partUri;
if (unit != 0) {
- partUri = dependency.parts[unit - 1];
+ String uri = dependency.parts[unit - 1];
+ Source partSource =
+ summaryResynthesizer.sourceFactory.resolveUri(librarySource, uri);
+ partUri = partSource.uri.toString();
} else {
partUri = referencedLibraryUri;
}
@@ -1131,7 +1134,7 @@ class _LibraryResynthesizerContext implements LibraryResynthesizerContext {
@override
LibraryElement buildImportedLibrary(int dependency) {
String depUri = resynthesizer.linkedLibrary.dependencies[dependency].uri;
- return _getLibraryByAbsoluteUri(depUri);
+ return _getLibraryByRelativeUri(depUri);
}
@override
@@ -1157,16 +1160,6 @@ class _LibraryResynthesizerContext implements LibraryResynthesizerContext {
BuildLibraryElementUtils.patchTopLevelAccessors(library);
}
- LibraryElementHandle _getLibraryByAbsoluteUri(String uriStr) {
- Source source =
- resynthesizer.summaryResynthesizer.sourceFactory.forUri(uriStr);
- if (source == null) {
- return null;
- }
- return new LibraryElementHandle(resynthesizer.summaryResynthesizer,
- new ElementLocationImpl.con3(<String>[uriStr]));
- }
-
LibraryElementHandle _getLibraryByRelativeUri(String depUri) {
Source source = resynthesizer.summaryResynthesizer.sourceFactory
.resolveUri(resynthesizer.librarySource, depUri);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698