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

Unified Diff: pkg/analyzer/lib/file_system/memory_file_system.dart

Issue 1612393002: fix embedder on Windows - fixes #25498 (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: fixed embedder and updated tests 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/lib/source/embedder.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/file_system/memory_file_system.dart
diff --git a/pkg/analyzer/lib/file_system/memory_file_system.dart b/pkg/analyzer/lib/file_system/memory_file_system.dart
index dc676bba812cec7a08264d13cf8fcb10b2c5a085..a8aca3812047868d59c6de627a70544fdce28ed0 100644
--- a/pkg/analyzer/lib/file_system/memory_file_system.dart
+++ b/pkg/analyzer/lib/file_system/memory_file_system.dart
@@ -28,11 +28,15 @@ class MemoryResourceProvider implements ResourceProvider {
new HashMap<String, List<StreamController<WatchEvent>>>();
int nextStamp = 0;
- final AbsolutePathContext absolutePathContext =
- new AbsolutePathContext(false);
+ final Context _pathContext;
+ final AbsolutePathContext absolutePathContext;
+
+ MemoryResourceProvider({bool isWindows: false})
+ : _pathContext = isWindows ? windows : posix,
+ absolutePathContext = new AbsolutePathContext(isWindows);
@override
- Context get pathContext => posix;
+ Context get pathContext => _pathContext;
/**
* Delete the file with the given path.
@@ -127,9 +131,8 @@ class MemoryResourceProvider implements ResourceProvider {
Folder newFolder(String path) {
path = pathContext.normalize(path);
- if (!path.startsWith(pathContext.separator)) {
- throw new ArgumentError(
- "Path must start with '${pathContext.separator}' : $path");
+ if (!pathContext.isAbsolute(path)) {
+ throw new ArgumentError("Path must be absolute : $path");
}
_MemoryResource resource = _pathToResource[path];
if (resource == null) {
« no previous file with comments | « no previous file | pkg/analyzer/lib/source/embedder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698