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

Unified Diff: pkg/analyzer/lib/source/embedder.dart

Issue 1600933007: fix embedder url mapping on Windows (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 11 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/test/source/embedder_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/source/embedder.dart
diff --git a/pkg/analyzer/lib/source/embedder.dart b/pkg/analyzer/lib/source/embedder.dart
index 5e111f4bc0a2f465d5dc9e93abc44ce18fbb434b..f77ff7c76dd12d577233a50989975e04e693cca3 100644
--- a/pkg/analyzer/lib/source/embedder.dart
+++ b/pkg/analyzer/lib/source/embedder.dart
@@ -207,7 +207,7 @@ class EmbedderSdk implements DartSdk {
String path;
for (SdkLibrary library in _librariesMap.sdkLibraries) {
- String libraryPath = library.path;
+ String libraryPath = library.path.replaceAll('/', JavaFile.separator);
if (filePath == libraryPath) {
path = '$_DART_COLON_PREFIX${library.shortName}';
break;
@@ -215,8 +215,8 @@ class EmbedderSdk implements DartSdk {
}
if (path == null) {
for (SdkLibrary library in _librariesMap.sdkLibraries) {
- String libraryPath = library.path;
- int index = libraryPath.lastIndexOf('/');
+ String libraryPath = library.path.replaceAll('/', JavaFile.separator);
+ int index = libraryPath.lastIndexOf(JavaFile.separator);
if (index == -1) {
continue;
}
@@ -224,7 +224,8 @@ class EmbedderSdk implements DartSdk {
if (!filePath.startsWith(prefix)) {
continue;
}
- var relPath = filePath.substring(prefix.length);
+ var relPath = filePath
+ .substring(prefix.length).replaceAll(JavaFile.separator, '/');
path = '$_DART_COLON_PREFIX${library.shortName}/$relPath';
break;
}
@@ -267,9 +268,12 @@ class EmbedderSdk implements DartSdk {
srcPath = library.path;
} else {
String libraryPath = library.path;
- int index = libraryPath.lastIndexOf('/');
+ int index = libraryPath.lastIndexOf(JavaFile.separator);
if (index == -1) {
- return null;
+ index = libraryPath.lastIndexOf('/');
+ if (index == -1) {
+ return null;
+ }
}
String prefix = libraryPath.substring(0, index + 1);
srcPath = '$prefix$relativePath';
« no previous file with comments | « no previous file | pkg/analyzer/test/source/embedder_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698