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

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

Issue 28943003: dart:io | Remove deprecated behavior of Directory('').createTemp, replaced by Directory.systemTemp. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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
« no previous file with comments | « sdk/lib/io/directory.dart ('k') | no next file » | 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 288364868df2b194827bd594a157b9ecb1755f04..c8402676638cb40984bf9428ec0f359480025061 100644
--- a/sdk/lib/io/directory_impl.dart
+++ b/sdk/lib/io/directory_impl.dart
@@ -155,9 +155,9 @@ class _Directory extends FileSystemEntity implements Directory {
Future<Directory> createTemp([String prefix]) {
if (prefix == null) prefix = '';
if (path == '') {
- return systemTemp.createTemp(prefix);
- // TODO(13720): On Oct 18, 2013, replace this with
- // an error. createTemp cannot be called on a Directory with empty path.
+ throw new ArgumentError(
+ "Directory.createTemp called with an empty path. "
+ "To use the system temp directory, use Directory.systemTemp");
}
String fullPrefix;
if (path.endsWith('/') || (Platform.isWindows && path.endsWith('\\'))) {
@@ -178,9 +178,9 @@ class _Directory extends FileSystemEntity implements Directory {
Directory createTempSync([String prefix]) {
if (prefix == null) prefix = '';
if (path == '') {
- return systemTemp.createTempSync(prefix);
- // TODO(13720): On Oct 18, 2013, replace this with
- // an error. createTemp cannot be called on a Directory with empty path.
+ throw new ArgumentError(
+ "Directory.createTemp called with an empty path. "
+ "To use the system temp directory, use Directory.systemTemp");
}
String fullPrefix;
if (path.endsWith('/') || (Platform.isWindows && path.endsWith('\\'))) {
« no previous file with comments | « sdk/lib/io/directory.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698