mirror of
https://github.com/dart-lang/sdk
synced 2024-07-20 05:25:05 +00:00
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:
parent
106c623a9f
commit
aaaeee5bc4
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue