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

Unified Diff: sdk/lib/_internal/pub/lib/src/io.dart

Issue 215503004: Pub's listDir shouldn't fail when called within hidden directories. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 9 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 | sdk/lib/_internal/pub/test/io_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/pub/lib/src/io.dart
diff --git a/sdk/lib/_internal/pub/lib/src/io.dart b/sdk/lib/_internal/pub/lib/src/io.dart
index d50e06860ae40981b4ab0e2ce948c5301fe13809..b054a770d1157370cf1428e9f3a3ffd7b9a2c4d9 100644
--- a/sdk/lib/_internal/pub/lib/src/io.dart
+++ b/sdk/lib/_internal/pub/lib/src/io.dart
@@ -256,8 +256,10 @@ List<String> listDir(String dir, {bool recursive: false,
isHidden(part) => part.startsWith(".") && part != "." && part != "..";
if (!includeHidden) {
- entities = entities.where(
- (entity) => !path.split(entity.path).any(isHidden));
+ entities = entities.where((entity) {
+ assert(entity.path.startsWith(dir));
Bob Nystrom 2014/03/28 15:42:07 I worry this will fail because of canonicalization
nweiz 2014/03/31 19:13:32 [Directory.list] guarantees that it will return pa
+ return !path.split(entity.path.substring(dir.length + 1)).any(isHidden);
+ });
}
return entities.map((entity) => entity.path).toList();
« no previous file with comments | « no previous file | sdk/lib/_internal/pub/test/io_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698