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

Unified Diff: pkg/analyzer/lib/src/dart/sdk/sdk.dart

Issue 2967503002: Fix the resolution of uri-based part-of directives in the SDK (issue 29598) (Closed)
Patch Set: moved test Created 3 years, 6 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 | pkg/analyzer/lib/src/summary/summarize_ast.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/dart/sdk/sdk.dart
diff --git a/pkg/analyzer/lib/src/dart/sdk/sdk.dart b/pkg/analyzer/lib/src/dart/sdk/sdk.dart
index a6c49083fdeb69ed4bd6bf51aa7daa3fbd7d398a..cfed575fb9872503f05c0ce444b759fa6a5c8946 100644
--- a/pkg/analyzer/lib/src/dart/sdk/sdk.dart
+++ b/pkg/analyzer/lib/src/dart/sdk/sdk.dart
@@ -651,7 +651,13 @@ class FolderBasedDartSdk extends AbstractDartSdk {
try {
File file = libraryDirectory.getChildAssumingFile(library.path);
if (!relativePath.isEmpty) {
- file = file.parent.getChildAssumingFile(relativePath);
+ File relativeFile = file.parent.getChildAssumingFile(relativePath);
+ if (relativeFile.path == file.path) {
+ // The relative file is the library, so return a Source for the
+ // library rather than the part format.
+ return file.createSource(Uri.parse(library.shortName));
+ }
+ file = relativeFile;
}
return file.createSource(Uri.parse(dartUri));
} on FormatException {
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/summary/summarize_ast.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698