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

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

Issue 2396423002: MemoryResourceProvider.getFolder() should not create the folder. (Closed)
Patch Set: Created 4 years, 2 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
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 a69e15eabd5820e2e34ef7da86da0e5e05ed411b..a603eaa3c47897827634a8986c956d771e3a8bdb 100644
--- a/pkg/analyzer/lib/file_system/memory_file_system.dart
+++ b/pkg/analyzer/lib/file_system/memory_file_system.dart
@@ -95,7 +95,13 @@ class MemoryResourceProvider implements ResourceProvider {
File getFile(String path) => new _MemoryFile(this, path);
@override
- Folder getFolder(String path) => newFolder(path);
+ Folder getFolder(String path) {
+ path = pathContext.normalize(path);
+ if (!pathContext.isAbsolute(path)) {
+ throw new ArgumentError("Path must be absolute : $path");
+ }
+ return new _MemoryFolder(this, path);
+ }
@override
Future<List<int>> getModificationTimes(List<Source> sources) async {
@@ -542,7 +548,7 @@ abstract class _MemoryResource implements Resource {
if (parentPath == path) {
return null;
}
- return _provider.getResource(parentPath);
+ return _provider.getFolder(parentPath);
}
@override

Powered by Google App Engine
This is Rietveld 408576698