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

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

Issue 2214233002: Tweak the rest of separator references to use the getter. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 4 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/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 554376fbeb5d898ba4ad1f35674fe2a0f4408a56..27e5549661d4f1f4f149769ec1d6bb93f3b87987 100644
--- a/pkg/analyzer/lib/src/dart/sdk/sdk.dart
+++ b/pkg/analyzer/lib/src/dart/sdk/sdk.dart
@@ -298,8 +298,7 @@ class EmbedderSdk extends AbstractDartSdk {
srcPath = library.path;
} else {
String libraryPath = library.path;
- int index =
- libraryPath.lastIndexOf(resourceProvider.pathContext.separator);
+ int index = libraryPath.lastIndexOf(separator);
if (index == -1) {
index = libraryPath.lastIndexOf('/');
if (index == -1) {
@@ -309,8 +308,7 @@ class EmbedderSdk extends AbstractDartSdk {
String prefix = libraryPath.substring(0, index + 1);
srcPath = '$prefix$relativePath';
}
- String filePath =
- srcPath.replaceAll('/', resourceProvider.pathContext.separator);
+ String filePath = srcPath.replaceAll('/', separator);
try {
File file = resourceProvider.getFile(filePath);
return file.createSource(parseUriWithException(dartUri));
@@ -536,8 +534,7 @@ class FolderBasedDartSdk extends AbstractDartSdk {
String getRelativePathFromFile(File file) {
String filePath = file.path;
String libPath = libraryDirectory.path;
- if (!filePath
- .startsWith("$libPath${resourceProvider.pathContext.separator}")) {
+ if (!filePath.startsWith("$libPath$separator")) {
return null;
}
return filePath.substring(libPath.length + 1);
« 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