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

Side by Side Diff: sdk/lib/io/file_impl.dart

Issue 11369243: Make Exception a class, not an interface, and remove the const constructor. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated. Moved safeToString to Error. Created 8 years, 1 month 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/html/scripts/systemhtml.py ('k') | tests/corelib/safe_to_string_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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 class _FileInputStream extends _BaseDataInputStream implements InputStream { 5 class _FileInputStream extends _BaseDataInputStream implements InputStream {
6 _FileInputStream(String name) 6 _FileInputStream(String name)
7 : _data = const [], 7 : _data = const [],
8 _position = 0, 8 _position = 0,
9 _filePosition = 0 { 9 _filePosition = 0 {
10 var file = new File(name); 10 var file = new File(name);
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after
350 // function. 350 // function.
351 class _FileUtils { 351 class _FileUtils {
352 external static SendPort _newServicePort(); 352 external static SendPort _newServicePort();
353 } 353 }
354 354
355 // Class for encapsulating the native implementation of files. 355 // Class for encapsulating the native implementation of files.
356 class _File extends _FileBase implements File { 356 class _File extends _FileBase implements File {
357 // Constructor for file. 357 // Constructor for file.
358 _File(String this._name) { 358 _File(String this._name) {
359 if (_name is! String) { 359 if (_name is! String) {
360 throw new ArgumentError('${NoSuchMethodError.safeToString(_name)} ' 360 throw new ArgumentError('${Error.safeToString(_name)} '
361 'is not a String'); 361 'is not a String');
362 } 362 }
363 } 363 }
364 364
365 // Constructor from Path for file. 365 // Constructor from Path for file.
366 _File.fromPath(Path path) : this(path.toNativePath()); 366 _File.fromPath(Path path) : this(path.toNativePath());
367 367
368 Future<bool> exists() { 368 Future<bool> exists() {
369 _ensureFileService(); 369 _ensureFileService();
370 List request = new List(2); 370 List request = new List(2);
(...skipping 709 matching lines...) Expand 10 before | Expand all | Expand 10 after
1080 new FileIOException("File closed '$_name'")); 1080 new FileIOException("File closed '$_name'"));
1081 }); 1081 });
1082 return completer.future; 1082 return completer.future;
1083 } 1083 }
1084 1084
1085 final String _name; 1085 final String _name;
1086 int _id; 1086 int _id;
1087 1087
1088 SendPort _fileService; 1088 SendPort _fileService;
1089 } 1089 }
OLDNEW
« no previous file with comments | « sdk/lib/html/scripts/systemhtml.py ('k') | tests/corelib/safe_to_string_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698