Make MemoryResourceProvider.convertPath() work with partially posix paths.

So that 'C:\some\path/to/file.dart' -> 'C:\some\path\to\file.dart'.

R=paulberry@google.com, brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/2542793003 .
This commit is contained in:
Konstantin Shcheglov 2016-12-01 08:39:44 -08:00
parent 106c623a9f
commit aaaeee5bc4

View file

@ -50,10 +50,11 @@ class MemoryResourceProvider implements ResourceProvider {
* this class are never converted automatically.
*/
String convertPath(String path) {
if (pathContext.style == pathos.windows.style &&
path.startsWith(pathos.posix.separator)) {
path = r'C:' +
path.replaceAll(pathos.posix.separator, pathos.windows.separator);
if (pathContext.style == pathos.windows.style) {
if (path.startsWith(pathos.posix.separator)) {
path = r'C:' + path;
}
path = path.replaceAll(pathos.posix.separator, pathos.windows.separator);
}
return path;
}