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

Side by Side Diff: runtime/bin/path_impl.dart

Issue 10989013: Change IllegalArgumentException to ArgumentError. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated co19 test expectations. Created 8 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 unified diff | Download patch | Annotate | Revision Log
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 _Path implements Path { 5 class _Path implements Path {
6 final String _path; 6 final String _path;
7 7
8 _Path(String source) : _path = source; 8 _Path(String source) : _path = source;
9 _Path.fromNative(String source) : _path = _clean(source); 9 _Path.fromNative(String source) : _path = _clean(source);
10 10
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 } 51 }
52 } 52 }
53 throw new NotImplementedException( 53 throw new NotImplementedException(
54 "Unimplemented case of Path.relativeTo(base):\n" 54 "Unimplemented case of Path.relativeTo(base):\n"
55 " Only absolute paths with strict containment are handled at present.\n" 55 " Only absolute paths with strict containment are handled at present.\n"
56 " Arguments: $_path.relativeTo($base)"); 56 " Arguments: $_path.relativeTo($base)");
57 } 57 }
58 58
59 Path join(Path further) { 59 Path join(Path further) {
60 if (further.isAbsolute) { 60 if (further.isAbsolute) {
61 throw new IllegalArgumentException( 61 throw new ArgumentError(
62 "Path.join called with absolute Path as argument."); 62 "Path.join called with absolute Path as argument.");
63 } 63 }
64 if (isEmpty) { 64 if (isEmpty) {
65 return further.canonicalize(); 65 return further.canonicalize();
66 } 66 }
67 if (hasTrailingSeparator) { 67 if (hasTrailingSeparator) {
68 return new Path('$_path${further._path}').canonicalize(); 68 return new Path('$_path${further._path}').canonicalize();
69 } 69 }
70 return new Path('$_path/${further._path}').canonicalize(); 70 return new Path('$_path/${further._path}').canonicalize();
71 } 71 }
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 if (pos < 0) return new Path(''); 210 if (pos < 0) return new Path('');
211 while (pos > 0 && _path[pos - 1] == '/') --pos; 211 while (pos > 0 && _path[pos - 1] == '/') --pos;
212 return new Path((pos > 0) ? _path.substring(0, pos) : '/'); 212 return new Path((pos > 0) ? _path.substring(0, pos) : '/');
213 } 213 }
214 214
215 String get filename { 215 String get filename {
216 int pos = _path.lastIndexOf('/'); 216 int pos = _path.lastIndexOf('/');
217 return _path.substring(pos + 1); 217 return _path.substring(pos + 1);
218 } 218 }
219 } 219 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698