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

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

Issue 21520002: Add argument check to Directory and Link constructors (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 5 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/file_impl.dart ('k') | tests/standalone/io/directory_fuzz_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/io/link.dart
diff --git a/sdk/lib/io/link.dart b/sdk/lib/io/link.dart
index 237154dc9a47db36a6e92d0645050cd960367b5d..8c28eb4e9ef2bcb4f5661145a62a6d6a17f21322 100644
--- a/sdk/lib/io/link.dart
+++ b/sdk/lib/io/link.dart
@@ -130,7 +130,13 @@ class _Link extends FileSystemEntity implements Link {
SendPort _fileService;
- _Link(String this.path);
+ _Link(String this.path) {
+ if (path is! String) {
+ throw new ArgumentError('${Error.safeToString(path)} '
+ 'is not a String');
+ }
+ }
+
_Link.fromPath(Path inputPath) : path = inputPath.toNativePath();
« no previous file with comments | « sdk/lib/io/file_impl.dart ('k') | tests/standalone/io/directory_fuzz_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698