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

Side by Side 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, 4 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 unified diff | Download patch | Annotate | Revision Log
« 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 part of dart.io; 5 part of dart.io;
6 6
7 /** 7 /**
8 * [Link] objects are references to filesystem links. 8 * [Link] objects are references to filesystem links.
9 * 9 *
10 */ 10 */
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 */ 123 */
124 String targetSync(); 124 String targetSync();
125 } 125 }
126 126
127 127
128 class _Link extends FileSystemEntity implements Link { 128 class _Link extends FileSystemEntity implements Link {
129 final String path; 129 final String path;
130 130
131 SendPort _fileService; 131 SendPort _fileService;
132 132
133 _Link(String this.path); 133 _Link(String this.path) {
134 if (path is! String) {
135 throw new ArgumentError('${Error.safeToString(path)} '
136 'is not a String');
137 }
138 }
139
134 140
135 _Link.fromPath(Path inputPath) : path = inputPath.toNativePath(); 141 _Link.fromPath(Path inputPath) : path = inputPath.toNativePath();
136 142
137 String toString() => "Link: '$path'"; 143 String toString() => "Link: '$path'";
138 144
139 Future<bool> exists() => FileSystemEntity.isLink(path); 145 Future<bool> exists() => FileSystemEntity.isLink(path);
140 146
141 bool existsSync() => FileSystemEntity.isLinkSync(path); 147 bool existsSync() => FileSystemEntity.isLinkSync(path);
142 148
143 Future<FileStat> stat() => FileStat.stat(path); 149 Future<FileStat> stat() => FileStat.stat(path);
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
309 if (path != null) { 315 if (path != null) {
310 sb.write(", path = $path"); 316 sb.write(", path = $path");
311 } 317 }
312 } 318 }
313 return sb.toString(); 319 return sb.toString();
314 } 320 }
315 final String message; 321 final String message;
316 final String path; 322 final String path;
317 final OSError osError; 323 final OSError osError;
318 } 324 }
OLDNEW
« 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