Index: pkg/analyzer/lib/source/embedder.dart |
diff --git a/pkg/analyzer/lib/source/embedder.dart b/pkg/analyzer/lib/source/embedder.dart |
index ffcbfed592f6aaff656a66ba4482dfd068c9c4d9..7c9ab54e595d4aab5ca24947019b0fab4e499e18 100644 |
--- a/pkg/analyzer/lib/source/embedder.dart |
+++ b/pkg/analyzer/lib/source/embedder.dart |
@@ -7,6 +7,7 @@ library analyzer.source.embedder; |
import 'dart:collection' show HashMap; |
import 'dart:core' hide Resource; |
+import 'dart:io' as io; |
import 'package:analyzer/file_system/file_system.dart'; |
import 'package:analyzer/source/package_map_provider.dart' |
@@ -75,7 +76,7 @@ class EmbedderSdk extends AbstractDartSdk { |
srcPath = library.path; |
} else { |
String libraryPath = library.path; |
- int index = libraryPath.lastIndexOf(JavaFile.separator); |
+ int index = libraryPath.lastIndexOf(io.Platform.pathSeparator); |
if (index == -1) { |
index = libraryPath.lastIndexOf('/'); |
if (index == -1) { |
@@ -85,7 +86,7 @@ class EmbedderSdk extends AbstractDartSdk { |
String prefix = libraryPath.substring(0, index + 1); |
srcPath = '$prefix$relativePath'; |
} |
- String filePath = srcPath.replaceAll('/', JavaFile.separator); |
+ String filePath = srcPath.replaceAll('/', io.Platform.pathSeparator); |
try { |
JavaFile file = new JavaFile(filePath); |
return new FileBasedSource(file, parseUriWithException(dartUri)); |