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

Unified Diff: sdk/lib/io/directory_impl.dart

Issue 1966373002: Revert "Fix strong mode errors in dart:io." (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 7 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 | « sdk/lib/_internal/js_runtime/lib/io_patch.dart ('k') | sdk/lib/io/http_impl.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/io/directory_impl.dart
diff --git a/sdk/lib/io/directory_impl.dart b/sdk/lib/io/directory_impl.dart
index 52cf54824ecf4e8ed14a4b5491ade076c4a32471..d76b86d83988a29832475e51735a738733f44390 100644
--- a/sdk/lib/io/directory_impl.dart
+++ b/sdk/lib/io/directory_impl.dart
@@ -22,9 +22,7 @@ class _Directory extends FileSystemEntity implements Directory {
external static _create(String path);
external static _deleteNative(String path, bool recursive);
external static _rename(String path, String newPath);
- external static void _fillWithDirectoryListing(
- List<FileSystemEntity> list, String path, bool recursive,
- bool followLinks);
+ external static List _list(String path, bool recursive, bool followLinks);
static Directory get current {
var result = _current();
@@ -224,18 +222,14 @@ class _Directory extends FileSystemEntity implements Directory {
followLinks).stream;
}
- List<FileSystemEntity> listSync(
- {bool recursive: false, bool followLinks: true}) {
+ List listSync({bool recursive: false, bool followLinks: true}) {
if (recursive is! bool || followLinks is! bool) {
throw new ArgumentError();
}
- var result = <FileSystemEntity>[];
- _fillWithDirectoryListing(
- result,
+ return _list(
FileSystemEntity._ensureTrailingPathSeparators(path),
recursive,
followLinks);
- return result;
}
String toString() => "Directory: '$path'";
« no previous file with comments | « sdk/lib/_internal/js_runtime/lib/io_patch.dart ('k') | sdk/lib/io/http_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698